Importing data
From ISPWiki
Contents |
General information
BILLmanager 4.0.54.1 and later provides a utility to import data from external billing systems. You can transfer directly from a database of a billing system into that of BILLmanager by using an executable file of the import tool and an XML file.
Since BILLmanager and an external billing system from which data should be imported may have incompatible functionality, you won't be able to import some data or they will be altered while importing.
We recommend importing to an empty BILLmanager database.
Billing systems which data can be imported
- Root Panel
- Joonte
- WHMCS
Instructions
The process of importing data includes:
Preparation
Following are the steps you need to go through to configure BILLmanager and an external billing system before performing the import:
- Restrict users' access to the billing system and BILLmanager to transfer all billing data and avoid errors with different Ids in the database.
- Install and run BILLmanager if you skipped this step.
- Back up the BILLmanager database to be able to restore BILLmanager from the backup copy.
- Back up the external billing system to avoid changes in its database. The billing data cannot be modified while importing. You can also back up the billing system's database and import from the backup copy rather than from the original database. You need first to create a new database and upload your data there.
- Go to the server where BILLmanager is installed to check the availability of the database you want to import from.
Importing data
The location of the executable file of the import tool is (path)/sbin/billimport, where (path) is the path to BILLmanager installation folder.
The location of the import rule files is (path)/var/billimport/, where (path) is the path to BILLmanager installation folder.
- Starting the import tool
There are two methods for starting the import tool:
- Without a graphic interface by transferring all required parameters described below when starting from the command line:
- H - show Help and quit the program
- V - show the program's version
- s - enable the non-graphical mode.
- v - display additional information, can only be used with the '-s' option.
- S - display a list of files available for import.
- h <hostname> - specify a <hostname> as the database server name of a remote billing.
- u <username> - specify a <username> as a username to gain access to the database server of a remote billing.
- p <password> - specify a <password> as a user password to gain access to the database server of a remote billing.
- n <dbname> - specify a <dbname> as a database name of a remote billing.
- f <filename> - specify a <filename> as an import rule file.
- Example: ./billimport -h 127.0.0.1 -sv -u username -p password -n dbname -f filename.importmap
- Using a graphic interface (see description below)
Start the import tool from the console. The Welcome window will be displayed:
- Choose import rules depending on the name of the external billing system
- Enter the name of the server where a database of the billing system is located
- Enter a username to connect to the database
- Enter a password to connect to the database
- Enter the name of the database you want to import the billing data from
If the connection fails, the program will prompt to check the data
- Import in progress
- Import complete
- The log file location is (path)/var/billimport.log, where (path) is the path to the BILLmanager installation folder.
Checking imported data
When the import is complete, check the followings:
- Errors in the import log file
- Company and project information
- Package groups
- Servers
- Domain name registrars
- Packages:
- Name
- Internal name
- Setup fee
- Active servers (registrars) available for this package
- Package add-ons and their prices
- Package order periods and their prices
- Other billing settings
- Customer accounts, their number and current balance of account
- Services, their number and order periods
- Available payment methods
- Administrators' privileges
- Customers' data
If the import failed, you need to restore the database and report the errors to the support center or Forum. When errors are fixed, you will be able to import the billing data again.
Technical details
Import configuration file format
An import file is an XML file that includes the following sections:
- Name of the system for which the rules are descried
Example:
<name>Root Panel</name> <desc>Import data from Root Panel</desc>
- Parameters that are used when importing data
Example:
<localparams> <param> <name>grpinc</name> <sql>select ifnull(max(id), 0)+1 from user</sql> </param> </localparams>
where :
- localparams - beginning of the parameters' separation
- param - beginning of the parameter's description
- name - parameter's name
- sql - SQL request to initialize the parameter. The request is made to the BILLmanager database
- Import rule for each table
Example:
<table> - beginning of the rule's description <name>admin_groups</name> - name of the base in the billing system <billname>user</billname> - name of the table in BILLmanager base <desc>Importing admin groups</desc> - rule's description <type>sql</type> - rule type <sql>select id as id, name as name, 'en' as lang, '1' as isgroup, '1' as account from admin_groups</sql> - SQL request for data sample from the external billing system's table <init>grpinc</init> - parameter that is initialized before processing the rule <fields> - description of table forms' comparison. It is a result of handling the request in the external billing system and table in BILLmanager <field> - beginning of comparison's description <name>id</name> - name of the field in the table <billname>id</billname> - name of the file in BILLmanager table <func>%id%+%grpinc%</func> - function is applied to the value that resulted from the request before recording into BILLmanager base. Where %id% is a field name (described in name), %grpinc% is the parameter that was initialized earlier. All these values should be specified before putting into the database. </field> <field> <name>name</name> <billname>name</billname> </field> <field> <name>lang</name> <billname>lang</billname> </field> <field> <name>isgroup</name> <billname>isgroup</billname> </field> <field> <name>account</name> <billname>account</billname> </field> </fields> </table>
Peculiarities of data import from different billing systems
Root Panel
Following are the data that you may import from Root Panel:
- Administrator's user groups
- Administrator's users (support staff), their names will follow new_.
- Customer accounts
- Customers' users
- Customers' profiles
- Customers' personal accounts
- Associated projects
- Associated companies
- Tickets and comments
- Servers
- Registrars
- Package groups
- Zone groups
- Domain packages
- Packages
- Domain orders
- Orders








