Backup

Back up everything a Zato environment needs to be recreated on any machine.

A Zato environment has two things to back up - the project in Git and any SQL databases that run outside the container. Each chapter below includes the restore procedure that its backup enables.

The project, in Git

Backup. Your project - the services, the enmasse YAML, the configuration files - is the whole of your environment's definition, so keeping it in Git backs up everything that the definition consists of. The enmasse export never includes passwords, so Git holds no secrets. The YAML references them as environment variables instead - see enmasse for how the references work.

Restore. Start a container with the project mounted and Zato_Project_Root pointing at it, following the deployment tutorial. On startup, the container deploys the services from the mount, imports the YAML and reads the secrets from the Zato_Enmasse_Env variables you pass it. A project in Git plus the Zato image is enough to recreate the environment on any machine.

Any SQL database outside the container

Backup. The Zato database, which holds pub/sub topics and messages, the audit log and the run state of scheduled jobs, can run on PostgreSQL outside the container rather than on its default SQLite database.

It is an ordinary database, so back it up the way you back up your other databases - you already have procedures, tooling and a retention policy for that, and Zato adds no further requirements.

Restore. Restore the database with your database's own tooling, then point the container at it with the Zato_Database_* variables described in the environment variables reference. A restored copy behaves the same as the original - the container connects to the database that its variables point at.

Note: Audit events cannot be rebuilt from anything, so if you keep records for compliance, give the audit log backups the same retention guarantees as the records themselves.

What needs no backup

The container filesystem needs no backup. A container is disposable - you rebuild it from the image plus what you mount into it, so there is nothing in it worth capturing. This has the following consequences:

  • The configuration of the environment is created again at each start from the project's enmasse YAML, so it needs no backup of its own.
  • The default SQLite Zato database also lives inside the container. The audit events, the pub/sub topics and undelivered messages, and the run state of scheduled jobs in it are not retained when the container is replaced. If they must be retained, run the Zato database on PostgreSQL outside the container, where the section above applies.
  • Anything you mounted yourself stays on the host and you decide whether to keep it - to send logs out of the container, see logging.

After a restore

The checks are the same as after any start - the server answers its ping endpoint, the Dashboard loads, the services are deployed, and the log is free of errors. For the full list, see starting and stopping.

See also

PageWhat it covers
Audit logThe database of API traffic records and its retention
EnmasseThe YAML export that makes the project the environment's definition

Learn more