BILLmanager 6 Startup, Advanced

Backup configuration

BILLmanager has a built-in function to create backups. By default, backups are not activated. Create and configure backups in  ToolsBackup. The Settings button will open the current backup task form or if there is no such backup task, a new task will be launched automatically.

BILLmanager only creates and saves only full backups.

Create a new backup plan 

Storage type

The billing system supports Dropbox, or it can save backups to an FTP server or in a separate directory on the BILLmanager server:

Storage settings 

The storage configuration form may differ depending on a selected storage type. The local storage configuration: 

Scheduler

The billing system can launch backup tasks daily at the specified time or weekly on the specified days:

Backup plan

The Backup Plan are settings that determine which backups will be kept and which will be deleted. Backups are selected according to the configured period: month, week, day. The backup plan configuration file sets the values for each period. They denote the number of latest periods to account for in the backup plan. Backups that are not within the set value are deleted. The default settings for the parameters are three months, three weeks, and six days. This means that the following backups will be kept:

  • backups created at the beginning of the last three months;
  • backups created at the beginning of the last three weeks;
  • backups created at the end of the last six days;

For periods "week" and "month", the first copy made for the period is retained; for the day period, the last copy of the period is retained. Backups are not kept for the period if set to zero or lower.

The configuration file with the backup plan settings is located in the /usr/local/mgr5/etc/.billmgr-backup/plans/ directory. Basic settings parameters:

  • dlimit — how many days to keep backups;
  • wlimit — how many weeks to keep backups;
  • mlimit — how many months to keep backups;
  • rewrite_today — keep only one backup per day if the value is on. When on, the saved backups are checked daily. If there are saved backups, the last backup of the current day is selected, the remaining backups will be deleted.

Example of how to configure a backup plan:

<archiver>tgz</archiver>
  <backup_type>full</backup_type>
  <dlimit></dlimit>
  <full_monthday></full_monthday>
  <full_period></full_period>
  <full_weekday></full_weekday>
  <id>plan1</id>
  <max_dir_size></max_dir_size>
  <max_file_size></max_file_size>
  <mlimit>3</mlimit>
  <name>plan1</name>
  <rewrite_today>on</rewrite_today>
 <storage>1</storage>
  <wlimit>3</wlimit>

With the specified settings, backups will be kept as of the beginning of the last three months, the last three weeks, and the last one for the current day. In the example, the values are set:

  • mlimit 3 — for each month, the first backup of the last three months is kept;
  • wlimit 3 — for each week, the first backup of the last three weeks is kept;
  • rewrite_today=on — all backups of the current day are kept Only the last backup of the day will be kept based on the results of the daily check.

Images

Images are not stored in the database, so they are not included in the backup.

You can find images:

ImagesPath
ticket attachments/usr/local/mgr5/var/ticket_attach/
icons/usr/local/mgr5/skins/userdata/
logos

Values after the local_ prefix may vary, as they are randomly generated.

  • for dragon theme:
    /usr/local/mgr5/skins/dragon/local_1add35676e9f/logo-billmgr.svg
  • for orion theme:
    /usr/local/mgr5/skins/orion/local_fe522d81e114/logo.png

Restore BILLmanager from backup

Restore via interface 

You can restore data in ToolsBackup configuration → select a backup→ click Restore button. 

Also, the billing system can restore system objects. Clicking the Data button opens a list of available components:

  • Files. It stores control panel configurations, user configurations, etc. To restore all data, select Files and click Details, then select F iles and click Restore. The billing system can restore system objects. Go to the file selection form → select Files → click View details
  • Database. It stores all accounts information, tariff plans, clients' expenses, etc. To restore data, select Database →click Details → select "<database server name>" → click Restore

During the restore process:

  • The data archive you want to restore will be copied from the storage to a temporary directory.
  • The archive contents will be extracted into the temporary directory.
  • Depending on a selected component, the selected files will be moved to a new location or database would be filled with data.

Restore via command line

Restoring files

Upload the backup file (archive) from the storage into a directory on the BILLmanager server and execute the following command:

tar -xz -C / -f <backup directory file>

To restore certain files from the archive:

tar -xz -C / -f <backup directory file> <file name>

To restore the whole data from the archive on FTP-server:

curl ftp://example.com/backup_2015-04-01_03-00-00/plan1-files-0.tgz | tar -xz -C / -f -

Restoring from database

Upload the backup file (archive) from the storage in the arbitrary directory on the BILLmanager server and execute the following command:

tar -xz --wildcards -O -f /path/to/archive/with/database'*.sql' | mysql -uroot -p billmgr

To restore the whole data from the archive on FTP-server:

curl ftp://example.com/backup_2015-04-01_03-00-00/database-billmgr-1.tgz | tar -xz --wildcards -O -f - '*.sql' | mysql -uroot -p billmgr