Creating a Backup and Restoring System

In this article:

Creating a Backup

Restoring System from Backup

Checking System Work and Volume of Restored Data

Backup can be used to restore system availability in case of unexpected behavior and also prevent loss of user data and made configuration changes.

Before restoring the system create a backup of the following objects:

TIP. It is recommended to set object copy frequency depending on how often new data is added. For example, for the main database determine frequency of adding API user accounts, for the cache database determine frequency of data change on schedule of cache update, for the local database determine frequency of adding new data to the Local Database data source. A backup is created after the peak of adding new data.

Creating a Backup

A procedure of creating a backup differs depending on the version of Foresight Mobile Platform.

To create a backup in Foresight Mobile Platform 21.10 and later:

  1. Create a script a and place it in the folder with the docker-compose.standalone.yml file used on installing mobile platform server.

  2. Make sure that data source cache is not being updated or deleted. To view background tasks log, use the Background Tasks subsection or the tasks API method. If background tasks are being executed, data integrity may be corrupted on creating a backup.

  3. Start the script. After this the standalone_backup_<backup creation date and time> folder for storing all backups will be created at the same level with the script.

  4. Move the created folder standalone_backup_<backup creation date and time> to the computer used for storing backups.

Template of the script for creating a backup (version 21.10 or later)

If on installing Foresight Mobile Platform a fault-tolerant cluster based on OKD/OCP is created:

  1. Create a script and place it on the computer that controls the cluster.

  2. Make sure that data sources cache is not being updated or deleted. To view background tasks log, use the Background Tasks subsection or the tasks API method. If background tasks are being executed, data integrity may be corrupted on creating a backup.

  3. Execute authentication in the system in Foresight Mobile Platform 21.04 or later:

oc login -u <User name> -p <password> <host>

  1. Start the script.

If Foresight Mobile Platform 21.04 or later is used, the cluster_backup_<backup creation date and time> folder for storing all backups will be created together with the script.

  1. Insert the backup of changed configuration files in the cluster.

Template of the script for creating a backup (version 21.04 or later)

Template for creating a backup (version 20.10 or earlier)

Restoring System from Backup

Restoring of system from backup differs depending on the version of Foresight Mobile Platform.

To restore system from backup in Foresight Mobile Platform 21.10 or later:

  1. Restore a virtual machine from backup if the system failure was caused the virtual machine itself.

  2. Execute one of the operations:

% docker-compose -f docker-compose.standalone.yml up

  1. Create a script and place it on the computer.

  2. Insert the backup of changed configuration files on the computer.

  3. Deny access of user to mobile platform server.

  4. Start the script.

NOTE. At the level of the script check if there is the standalone_backup_<backup creation date and time> folder with saved backups. If there are several such folders, specify name of the required folder as the first argument.

  1. Check system work and volume of restored data.

  2. Allow access of users to mobile platform server.

Template of the script for restoring system from backup (version 21.10 or later)

If on installing Foresight Mobile Platform a fault-tolerant cluster based on OKD/OCP is created, select one of the methods:

NOTE. At the level of the script the system checks if there is the cluster_backup_<backup creation date and time> folder with saved backups. If there are several such folders, specify name of the required folder as the first argument.

Template of the script for restoring system from backup (version 21.04 or later)

Template for restoring system from backup (version 20.10 or earlier)

Checking System Work and Volume of Restored Data

To check system work and volume of data restored from backup:

  1. Check cache data volume. If the data volume is not full, delete cache and add it again in the Cache Control subsection.

  2. Reset JWT expiration time for API users and administrators. To do this, change values of the parameters: Expiration Time of JWT Token for API Users, Expiration Time of JWT Token for Administrators, Expiration Time of refresh JWT for API Users and Administrators in the Security subsection.

  3. Add accounts of API users if they were added after creating a backup.

  4. Restore access of users to the cluster.

See also:

System Error Monitoring