Backup and restore

Regular backup of data and configuration, and restore from a copy of the same installation.

Deployment methodThe commands on this page apply to the Docker Compose delivery. Open the matching Kubernetes and Helm procedure.

Backup

Back up application data, the installed version's configuration and the license file. Store copies separately from the installation server, accessible only to authorized staff, encrypted in transit and at rest. Backup and restore are performed with standard OS and Docker Compose tooling; the delivery package does not include backup scripts.

Recommended schedule

Daily copies — at least the last 7 days; weekly — at least the last month; monthly — at least the last year.

Data storage volumes

Data is stored in the following volumes:

  • postgres_data
  • clickhouse_data
  • kafka_data
  • redis_data

Do not store backups in Git, issues, CI artifacts or public directories.

Backup procedure

Make sure there is enough free space on the server, then stop the application with the standard Docker Compose command:

bash
docker compose -p ms-onprem -f docker-compose.onprem.yml --env-file .env stop

Copy the data (application volumes) and configuration to secure storage:

bash
# Copy the PostgreSQL volume
docker run --rm -v ms-onprem-postgres-data:/data -v /backup:/backup \
  alpine tar czf /backup/postgres-data.tar.gz -C /data .

# Copy the ClickHouse volume
docker run --rm -v ms-onprem-clickhouse-data:/data -v /backup:/backup \
  alpine tar czf /backup/clickhouse-data.tar.gz -C /data .

# Copy the Kafka volume
docker run --rm -v ms-onprem-kafka-data:/data -v /backup:/backup \
  alpine tar czf /backup/kafka-data.tar.gz -C /data .

# Copy the Redis volume
docker run --rm -v ms-onprem-redis-data:/data -v /backup:/backup \
  alpine tar czf /backup/redis-data.tar.gz -C /data .

# Copy the installation configuration
cp -a .env manifest.json docker-compose.onprem.yml clickhouse /backup/

Start the application, verify the login page is available and record the date, contents and result of the copy:

bash
docker compose -p ms-onprem -f docker-compose.onprem.yml --env-file .env start

Restore

Restore is performed only from a backup of the same installation. Before starting, stop the application and make sure the copy is intact.

Restore procedure

Save the current configuration and data to a separate copy, then stop the application with the standard Docker Compose command:

bash
docker compose -p ms-onprem -f docker-compose.onprem.yml --env-file .env stop

Restore the data and configuration from the chosen copy. Restore manifest.json schema v2 together with .env:

bash
# Restore the PostgreSQL volume
docker run --rm -v ms-onprem-postgres-data:/data -v /backup:/backup \
  alpine sh -c 'rm -rf /data/* /data/.[!.]* /data/..?* && tar xzf /backup/postgres-data.tar.gz -C /data'

# Restore the ClickHouse volume
docker run --rm -v ms-onprem-clickhouse-data:/data -v /backup:/backup \
  alpine sh -c 'rm -rf /data/* /data/.[!.]* /data/..?* && tar xzf /backup/clickhouse-data.tar.gz -C /data'

# Restore the Kafka volume
docker run --rm -v ms-onprem-kafka-data:/data -v /backup:/backup \
  alpine sh -c 'rm -rf /data/* /data/.[!.]* /data/..?* && tar xzf /backup/kafka-data.tar.gz -C /data'

# Restore the Redis volume
docker run --rm -v ms-onprem-redis-data:/data -v /backup:/backup \
  alpine sh -c 'rm -rf /data/* /data/.[!.]* /data/..?* && tar xzf /backup/redis-data.tar.gz -C /data'

# Restore the installation configuration (manifest.json together with .env)
cp -a /backup/.env /backup/manifest.json /backup/docker-compose.onprem.yml /backup/clickhouse .

Start the application, open the login page and verify data availability:

bash
docker compose -p ms-onprem -f docker-compose.onprem.yml --env-file .env start