In this article:
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:
The main Database. It contains user API accounts, connection parameters for data source and their resources, environment and project parameters, connection parameters for LDAP directory, APNs certificates for sending push notifications, and so on.
The cache Database. It contains cache data requested with a mobile platform server or mobile device form data source.
The local Database. It contains data of the Local Database data source.
The minio File Storage. It contains loaded files and certificates for connecting to data sources.
Configuration Files. It contains changed information about set RAM limits, containers in use, and other system settings.
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.
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:
Create a script a and place it in the folder with the docker-compose.standalone.yml file used on installing mobile platform server.
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.
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.
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:
Create a script and place it on the computer that controls the cluster.
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.
Execute authentication in the system in Foresight Mobile Platform 21.04 or later:
oc login -u <User name> -p <password> <host>
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.
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 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:
Restore a virtual machine from backup if the system failure was caused the virtual machine itself.
Execute one of the operations:
Start Docker containers if they were stopped:
% docker-compose -f docker-compose.standalone.yml up
Reinstall Foresight Mobile Platform if required.
Create a script and place it on the computer.
Insert the backup of changed configuration files on the computer.
Deny access of user to mobile platform server.
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.
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:
Roll back the working cluster to original state:
Create a script and place it on the computer that controls the cluster.
Deny access of users to the cluster.
Start the script.
Allow access of users to the cluster.
Deploy again the cluster based on OKD/OCP:
Places copies of configuration files on the computer, which controls the cluster.
Make sure that users do not work with the cluster and backups were created in the version of Foresight Mobile Platform corresponding to the installed one.
Create a script and place it on the computer that controls the cluster.
Start the script.
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.
Allow access of users to the cluster.
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)
To check system work and volume of data restored from backup:
Check cache data volume. If the data volume is not full, delete cache and add it again in the Cache Control subsection.
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.
Add accounts of API users if they were added after creating a backup.
Restore access of users to the cluster.
See also: