AnyLogic
Expand
Font size

Backing up and restoring Private Cloud

Applies to AnyLogic Cloud 2.5.1. Last modified on December 09, 2024.

To check your Cloud version, go to <https://your Private Cloud instance address>/build.txt in your preferred web browser. To check the version of the installation script, see <the folder containing the installation script>/templates/preload_frontend_build.json.
For version differences, see the release notes.

Each Private Cloud instance comes with the service scripts which you can use to easily create a new backup or restore all data from an existing backup and then apply it to the freshly installed instance.

This can be useful in many cases, such as:

  • When you need to move the Private Cloud instance from one server machine to another
  • To ensure the data safety between updates
  • When you need to automate daily backups of all Cloud data

By backing up the Private Cloud instance, you preserve the configuration of your instance, keep service data and user accounts in safety, retain information about your model runs — and the models themselves.

In version 2.5.0, the architecture of AnyLogic Cloud has changed and the cassandra service component has been removed from the product. The backup and restore scripts created for 2.5.0 are therefore incompatible with older versions of Private Cloud. To perform backups and restores, use the scripts for the appropriate version.

Backup structure

Backup scripts work with the following Cloud service components:

Component Contents Backup mechanism
fileserver
(based on MinIO)
Model files — JARs and attached files
Static assets of the Private Cloud web UI
Service files (such as Java policies)
The fileserver component is backed up by creating a copy of the MinIO anylogic-cloud bucket.
By default, you can view the contents of this bucket in the cache/fileserver directory on the server machine running the fileserver Docker container.
postgres
(PostgreSQL database)
User accounts
Experiment data
Database records about models
Model version data
Model run results
Run configurations
Other Cloud metadata
The database is backed up by the pgdump tool.
The resulting backup is an SQL file that is copied to the location of the backup image.
cassandra
(Cassandra database management system)
Legacy
Model run results
Run configurations
The state of Cassandra is preserved in a snapshot. Snapshots are created using built-in Cassandra functionality.
The resulting snapshot is copied by executing a particular Docker command (depending on your version of Private Cloud).
Not used as of AnyLogic Cloud 2.5.0.

In addition, backup images also contain information about UI customization.

Private Cloud backups do not preserve changes made to configuration files.

Each Private Cloud backup is a directory containing the following sub-directories:

  • fileserver — Contains the fileserver backup.
  • db — Contains the backup of the PostgreSQL database.
  • cassandra (legacy) — Contains the backup of Cassandra. Not used as of AnyLogic Cloud 2.5.0.

Known restrictions

  • For backup and restore scripts to work, the listed service components (fileserver, postgres, and, if applicable, cassandra) should be present on the server machine where the script in question is being executed.
    • In Private Cloud Lite and Private Cloud Pro, these components are executed on the same machine by default.
    • In Private Cloud Enterprise, you have to make sure the components are executed on the same machine before executing the backup or restore script.
All commands listed below should be executed in your Linux terminal.
Before proceeding with any of the described scenarios, open the terminal and navigate to the folder containing the unzipped installation package of Private Cloud.
To execute backups, use the same version of the installation script you had when installing Private Cloud. To compare versions of the instance and installation script, check their version numbers:
To learn which version the instance has, go to <your instance address>/build.txt.
To learn which version the installation script has, open <the folder containing the installation script>/templates/preload_frontend_build.json.
To learn how to install Private Cloud and where to retrieve the installation package, see Installing Private Cloud.

Locating the backup tools

The backup tools are placed upon installation of the instance in the Private Cloud home directory, in the tools directory. This directory will be also created automatically after the update.

To execute backup scripts, you need sudo or root privileges.

To create a backup of the instance

  1. Execute the backup script:
    sudo tools/backup.sh
  2. Supply a path to the directory that will contain the future backup.
    You cannot place backup files in the AnyLogic Cloud home directory or user directory.

Consider launching the script while passing the path to the backup directory as an argument, for example:

sudo tools/backup.sh /path/to/backup

Additionally, you may want to ensure compatibility with an older version of the Private Cloud backup tool. In this case, the path should be passed as the value of the backup_dir option:

sudo tools/backup.sh backup_dir=/path/to/backup

To restore an instance from a backup image in Private Cloud

  1. Execute the restore script:
    sudo tools/restore.sh
  2. Supply a path to the directory containing the backup image.

Consider launching the script while passing the path to the image as an argument, for example:

sudo tools/restore.sh /path/to/backup

Additionally, you may want to ensure compatibility with an older version of the Private Cloud restore tool. In this case, the path should be passed as the value of the backup_dir option:

sudo tools/restore.sh backup_dir=/path/to/backup
How can we improve this article?