Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Backups per engine

How to back up the database of an Exponential site on each engine (sqlite3 .backup or VACUUM INTO, pg_dump, mongodump, mariadb-dump and mysqldump with --single-transaction, Data Pump for Oracle), what else belongs in a…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/help/database-administrators/backups-per-engine.md

On this page

Backups per engine

This page is for database administrators who set up or review the backups of an Exponential site. It answers: which command backs up each engine consistently, what must be backed up with the database, when maintenance mode is needed, and how to check a backup. Sources: Database support, backup and restore and 10.9 Backups and restore.

Contents

  1. A complete backup
  2. The database, per engine
  3. Consistency and maintenance mode
  4. A portable second format
  5. Verifying a backup
  6. Schedules and retention
  7. Checklist

A complete backup

A complete backup is the database and the files, taken at the same moment:

PathWhy
the databasecontent, users, settings stored in tables
var/storage and var/<site>/storageuploaded images and files
settings/override, settings/siteaccessthe installation's settings, with the database password
your own extensions and designsif they are not in a repository
var/storage/sqlite3/the database, on SQLite (taken with SQLite's tools, below)

Caches (var/cache, var/<site>/cache) need no backup; they are regenerated. A database backup alone does not restore a site: content refers to files in var/storage.

The database, per engine

EngineBackupNote
SQLite 3sqlite3 var/storage/sqlite3/exponential.db ".backup '/backup/exponential.db'"online and consistent while the site runs; or "VACUUM INTO '/backup/exponential.db'" (SQLite 3.27+) for a compacted copy. Never copy a database file that is in use
PostgreSQLpg_dump -U exponential -Fc exponential > exponential.dumpthe custom format restores selectively
MongoDBmongodump --uri="mongodb://exponential@localhost:27017/exponential" --out=/backup/exponentialthe tool asks for the password
MariaDBmariadb-dump --single-transaction -u exponential -p exponential > exponential.sqlmysqldump is the older name
Oraclephp bin/php/console ext:ezoracle:datapump --export=db.dmpor Oracle's expdp
MySQLmysqldump --single-transaction -u exponential -p exponential > exponential.sql

--single-transaction gives a consistent dump of InnoDB tables without locking them. -p without a value makes the client ask for the password; never write it on the command line, prefer the tools' prompts or option files. Point-in-time recovery (PostgreSQL WAL archiving, MySQL binary logs, MongoDB oplog, Oracle RMAN) is the engine's own feature and works with Exponential as with any application; configure it on the server.

Consistency and maintenance mode

On SQLite and on MySQL or MariaDB with InnoDB the database backup is consistent without maintenance mode. Maintenance mode makes the database and the files agree, because nothing is uploaded between the two:

php bin/php/maintenance.php on --message="Back soon" --until=30m --allow-root-user
# database backup, then:
tar czf /backup/files-$(date +%F).tar.gz var/storage settings/override settings/siteaccess
php bin/php/maintenance.php off --allow-root-user

--allow-admin keeps the administration reachable, --allow-ip lets given addresses through (Maintenance mode). For a nightly backup of a busy site, many operators accept a few minutes of difference between files and database instead; then take the database first and the files right after.

A portable second format

Next to the engine's native dump, a .dba dump is independent of the engine and can be loaded into another SQL engine:

php bin/php/ezsqldumpschema.php --type=mysql --user=exponential --password='<password>' \
    --format=generic --output-array --output-types=all exponential var/backup/site.dba --allow-root-user

It is slower and larger than a native dump and takes the password on the command line (Schema tools). It is not available for MongoDB.

Verifying a backup

EngineCheck
SQLitesqlite3 /backup/exponential.db "PRAGMA integrity_check" prints ok
PostgreSQLpg_restore --list exponential.dump lists the objects without error
MySQL, MariaDBthe dump ends with -- Dump completed; the file is not empty
MongoDBmongorestore --dryRun on the directory
Oraclethe Data Pump log reports success

The real check is a restore on another machine (Restoring a database). A backup that was never restored is a hope, not a backup.

Schedules and retention

Keep backups away from the server and keep several generations. Backups hold e-mail addresses and password hashes: encrypt them and delete old generations on schedule. Schedules for hosting companies are on Backup schedules and retention.

Checklist

  • To do: The database command of your engine runs nightly and is consistent.
  • To do: var/storage, settings/override and settings/siteaccess are backed up with it.
  • To do: SQLite is backed up with .backup or VACUUM INTO, never with cp.
  • To do: No password on a command line or in a crontab.
  • To do: Backups are verified, encrypted and kept off the server.
  • To do: A restore was tested this quarter.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x