Skip to content

Hosting: backup and restore#

This documentation applies to Piler enterprise edition 2.2.5+

Revision #1

Publication date: 2026-OCT-25

The deployment#

Back up every node as described in large deployments: backup and recovery: the databases, the stored emails (or the S3 buckets), the Manticore indexes, the encryption key, the configuration. The database first, then the emails.

With S3 storage, enable versioning or replication of the buckets, or back them up with your object storage's tools: a bucket holds one tenant's emails.

A single tenant#

A tenant is a database, a set of Manticore tables and a bucket (or a directory in the store), on each node: it can be backed up and restored on its own, without touching the other tenants.

Back up#

On each node (the single node, or every worker; the master holds the tenant's settings, users and audit log):

T=customer1

# The database, consistent while piler is running
docker compose exec piler sh -c \
   "mariadb-dump --defaults-file=/etc/piler/.my.cnf --single-transaction $T" > $T-db.sql

And the tenant's Manticore table, without stopping it: FREEZE keeps its files consistent while you copy them (Piler keeps archiving meanwhile), UNFREEZE releases it. In the Manticore container:

mysql -h0 -P9306 -e "FREEZE customer1"
cp -a /var/lib/manticore/customer1 /backup/manticore-customer1
mysql -h0 -P9306 -e "UNFREEZE customer1"

Restore#

Restore the database, the Manticore table and the emails to the same point in time, on every node of the tenant:

T=customer1

# The database
docker compose exec -T piler sh -c \
   "mariadb --defaults-file=/etc/piler/.my.cnf $T" < $T-db.sql

# The Manticore table (in the Manticore container): the backup files are
# copied into Manticore's data directory under the table name
mysql -h0 -P9306 -e "DROP TABLE customer1"
mysql -h0 -P9306 -e "IMPORT TABLE customer1 FROM '/backup/manticore-customer1/customer1'"

The emails: restore the bucket's objects (or the store directory /var/piler/store/<server id>/customer1) to the same point.

Instead of restoring the Manticore table, reindex rebuilds it from the database and the stored emails; slower for a large tenant, but it needs no index backup:

docker compose exec piler reindex -tenantid customer1 -start <min id> -stop <max id> -progress

Erasures after the backup#

Restoring an older state brings back what was removed since: emails a user or a data officer removed, a GDPR erasure, a retention purge. Keep a record of the removals and repeat them after a restore (the audit log has them, see GDPR erasure), and set your backup retention with your compliance obligations in mind.