Backing up and restoring

Use Control Center to back up applications that Control Center manages. Having accurate and tested system backups can mitigate problems caused by software or hardware issues.

Having accurate and tested system backups can mitigate problems caused by software or hardware issues. To have a historical archive, you might back up on a regular schedule. Back up as needed when you want to move data from one instance to another or duplicate an instance for testing or failover purposes.

Backups include the current state of the system, the state of all services, configuration information, and application data. The backup process leverages snapshot functionality. Therefore, when a backup is running, you can start and restart services; there is no need to shut down the application or Docker containers. The services are only momentarily suspended to enable reading the data.

You can back up and restore applications by using the browser interface or the command-line interface (CLI). Results are comparable; however, the CLI offers an option to exclude subdirectories from a backup.

The Control Center backup process creates a compressed tar archive file (.tgz) that can be restored on the same cluster or a similar cluster. Before starting a backup, Control Center estimates the size of the backup file and compares it to the amount of free space. If storage space is insufficient, Control Center does not start a backup.

The default directory for backup files is /opt/serviced/var/backups. The directory can be changed by specifying the SERVICED_BACKUPS_PATH environment variable in the Control Center configuration file, /etc/default/serviced.

When a full backup is not necessary, such as when you need a checkpoint before installing software, you can perform a snapshot of the system. If you need to revert back to a snapshot, use the rollback feature. You use the CLI to perform snapshot and rollback.

With both backup and snapshot, Control Center
  • Creates a tag for the Docker image of each service with metadata about the application data.
  • Creates a separate snapshot of the LVM thin pool, which stores both application data and snapshots of the application data.

When you create a backup, Control Center also exports the snapshots to an archive file and moves them out of the LVM thin pool. Backups do not affect time-to-live (TTL).

For more information, see Creating snapshots and rolling back and Command-line interface reference.