BILLmanager 6
en En
es Es

Backup configuration

This is an article about backing up platform settings. For information on selling the backup service, see the Backup service section.

BILLmanager has a built-in function for creating platform backups. By default, backup is not performed.

Creating a new backup plan 

To create a new backup task, go to the Tools → Backup section → Settings button.

Storage type

You can save backups in the Dropbox cloud service, on an FTP server, or in a separate directory on the platform server.

We do not recommend saving the backup to the platform server. In the event of a disk failure, server loss, or malicious attack, the system and its backups will be lost simultaneously.

Storage settings

The storage configuration form differs depending on the selected storage type.

To configure backup to a local storage:

  1. Select the Local storage type.
  2. Fill in the fields:

    1. Name — specify the name of the storage that will be displayed in the interface. For example, local.
    2. Path to directory — specify the directory on the server where backups will be saved. For example, /var/backup. Ensure that the directory exists and is writable by the user on whose behalf the configuration is performed.
  3. Click Next to proceed to schedule configuration.

To configure backup to an FTP storage:

  1. Select the storage type: FTP.
  2. Fill in the fields:
    1. Name — specify the name of the storage that will be displayed in the interface. For example, local.
    2. URL — specify the URL-address of the FTP server where backups will be saved. For example, ftp.example.com.
    3. User — specify the account name for connecting to the FTP server. For example, username.
    4. Password — specify the password for connecting to the FTP server. To check the entered characters, click the show password button to the right of the field.
  3. Click Next to proceed to schedule configuration.

To configure backup to Dropbox:

  1. Select the storage type: Dropbox.
  2. Go to www.dropbox.com and log in to your Dropbox account.
  3. Grant access to the Apps folder in your Dropbox.
  4. After authorization and granting access, the access code is automatically inserted into the field. Save it — the code may be needed when reconfiguring the storage.
  5. Click Next to proceed to schedule configuration.

Scheduler

To configure the backup schedule:

  1. Fill in the fields:
    1. Server date and time — informational field, not filled in. Displays the current server time, which will be used to calculate task execution. For example, 19.11.2026, 03:58:40.
    2. Run — select the task execution frequency:
      • daily — the task will run every day at the specified time;
      • weekly — select the days of the week when the backup should be performed.
    3. Time — specify the start time for the backup task. For example, 03:00.
  2. Click Finish to save the task.

Other

The system allows performing Reset properties. Select this option to delete backup settings and backup information. Data from the storages is not deleted.

Backup plan

The backup plan determines which backups will be saved and which will be deleted. The platform selects copies according to the configured period: month, week, day. In the configuration file, values are set for each period. They indicate the number of recent periods to be accounted for in the backup plan. Copies that do not fall within the specified number of periods are deleted. By default, the parameters are set to values: three months, three weeks, and six days. This means that backups made will be stored:

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

For "week" and "month" periods, the first copy made during the period is saved; for the "day" period, the last copy of the period is saved. Backups are not stored for a period if the value is 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. Main parameters:

  • dlimit — how many days to keep copies;
  • wlimit — how many weeks to keep copies;
  • mlimit — how many months to keep copies;
  • rewrite_today — keep only one copy per day if the value is on. When set to on, the platform checks saved backups daily. If copies exist, the platform keeps the last copy of the current day and deletes the rest.

BILLmanager creates and saves only full copies. Full copies take up a significant amount of disk space. Consider the storage capacity when configuring backups. Before configuration, estimate how much space one full copy takes, multiply it by the number of copies that will be stored with the selected dlimit, wlimit, and mlimit, and compare it with the available capacity. If there is not enough space, increase the storage capacity or reduce the retention depth. Otherwise, old copies may not be saved or the task will end with an error.

Example of backup plan configuration:
<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, copies will be saved for the beginning of the last three months, the last three weeks, and the last one for the current day. The example sets the following values:

  • mlimit 3 — for each month, the first backup copy of the last three months is stored;
  • wlimit 3 — for each week, the first backup copy of the last three weeks is stored;
  • rewrite_today=on — all backup copies of the current day are saved. As a result of the daily check, only the last copy of the day will be saved.

Monitoring backup tasks

The platform automatically logs events:

  • successful completion of scheduled backups;
  • critical and non-critical errors during the creation or restoration of copies.

To view messages about the copying status, go to the System status → Notifications section. For more details, see the Automatic troubleshooting article.

Images

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

You can find images at the following paths:

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

Values after the local_ prefix may differ, as they are generated randomly. For example,

/usr/local/mgr5/skins/dragon/local_1add35676e9f/logo-billmgr.svg

Restoring BILLmanager from a backup

It is recommended to regularly restore a backup on a separate server. This procedure confirms data integrity and the correctness of storage settings before a real incident.

Restoration via the interface

To restore the platform from a backup, go to the Tools → Backup section → select the desired copy → Restore button. This method initiates a full restoration of the billing platform.

The platform supports restoring individual system components. The Data button opens a list of available components:

  • Files. The component stores platform settings and user settings. To restore all files, select the Files component → Details button → select the files element → Restore button. Restoration of individual files is supported. To do this, go to the file selection form → select the files element → click the View files button.
  • Database. The component stores all information: about accounts, tariff plans, client expenses. To restore data, select the Database component → Details button → select the <database name on server> element → Restore button.

During the restoration process:

  • the data archive is copied from the storage to a temporary directory on the server;
  • the archive contents are extracted to a temporary directory on the server;
  • depending on the selected components, the selected files are moved to the target directories, and the database is populated with data from the archive.

Restoration via command line

Restoring files

Place the backup file (archive) from the storage into an arbitrary directory on the BILLmanager server, and then execute the command:

Executing the command replaces current data with data from the backup. Changes made after the backup was created will be deleted. Before executing the command, create a backup of the current state.
tar -xz -C / -f <backup file directory>

Command to restore specific files from the archive:

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

Command to restore from an archive on an FTP server:

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

Restoring the database

Place the backup file (archive) from the storage into an arbitrary directory on the BILLmanager server, and then execute the command:

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

Command to restore from an archive on an 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

Restoring the platform to a working state takes an average of no more than 10 minutes. The actual time may be longer and depends on:

  • database size;
  • file size;
  • storage write speed;
  • server load;
  • network limitations.

May be useful