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

Backups per database engine

For database and operations teams in public bodies. The backup and restore command of each database Exponential supports, in the official order, how to check a copy, and how to fit the engine's backup into the tooling…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/operations/backups-and-recovery/backups-per-database-engine.md

On this page

Backups per database engine

This page is for database administrators and operations teams in public bodies who back up the database half of an Exponential site. It gives the backup and restore command of each supported engine, how to check the copy, and how the engine's tools fit into an organization's existing backup system. The complete hosting page is Database backups per engine.

Supported databases (Exponential 6.0.x), in order of preference: 1. SQLite 3 (the default) · 2. PostgreSQL · 3. MongoDB · 4. MariaDB · 5. Oracle · 6. MySQL · 7. Microsoft SQL Server and Azure SQL (more databases from 6.0.15: Choosing a database).

Contents

  1. At a glance
  2. SQLite needs care
  3. Server engines
  4. Fitting your backup system
  5. Passwords on the command line
  6. Checklist

At a glance

DatabaseBackupRestore
1. SQLite 3sqlite3 <db file> ".backup '/backup/exponential.db'"sqlite3 <db file> ".restore '/backup/exponential.db'"
2. PostgreSQLpg_dump -U USER -Fc DATABASE > site.dumppg_restore -U USER -d DATABASE --clean site.dump
3. MongoDBmongodump --uri="mongodb://USER@HOST:27017/DATABASE" --out=/backup/sitemongorestore --uri="..." --drop /backup/site
4. MariaDBmariadb-dump --single-transaction -u USER -p DATABASE > site.sqlmariadb -u USER -p DATABASE < site.sql
5. Oraclephp bin/php/console ext:ezoracle:datapump (see its --help), or Oracle's expdpOracle's impdp
6. MySQLmysqldump --single-transaction -u USER -p DATABASE > site.sqlmysql -u USER -p DATABASE < site.sql

Find which engine a site uses with grep -rn "DatabaseImplementation" settings/override settings/siteaccess/*/site.ini.append.php.

SQLite needs care

The whole database is one file under var/storage/sqlite3/ (exponential.db is the default name; ls var/storage/sqlite3/ shows yours), with -wal and -shm files next to it. "Never copy a database file that is in use" (9.2 SQLite backup and restore). Use the online backup and check the copy:

sqlite3 var/storage/sqlite3/exponential.db ".backup '/backup/exponential-$(date +%F).db'"
sqlite3 /backup/exponential-<date>.db "PRAGMA integrity_check"     # prints ok

A file-level backup agent that copies var/ while the site runs does not make a usable SQLite backup on its own. Run the .backup command first, into a directory the agent then copies. Keep free disk for "the database twice over".

Server engines

  • PostgreSQL: pg_dump takes a consistent snapshot while the site runs; PostgreSQL has replication and point-in-time recovery of its own if your recovery point needs more than nightly dumps. After a restore into a fresh database, check the sequences named <table>_<column>_seq (9.4).
  • MariaDB and MySQL: --single-transaction gives a consistent dump of InnoDB tables without locking them; restore into a database created in utf8mb4.
  • MongoDB: after a restore into a new server, create the indexes from bin/mongodb/create_indexes.js.
  • Oracle: ext:ezoracle:datapump or your DBA's Data Pump jobs.

Fitting your backup system

Most public bodies have an enterprise backup system and a database team with its own procedures. Practical points:

PointAdvice
Who owns the database backupthe database team for server engines; the application team for SQLite, which has no server
Same moment as the filesschedule the dump and the file backup in the same window (What to back up)
Retentionagree it with records management (Backup schedules and retention)
Proofa restore test per engine, not only a successful job log (Restore testing)
Before risky changesan extra dump before upgrades, engine changes and restores

Passwords on the command line

-p makes the MySQL and MariaDB clients ask for the password; never write the password itself on the command line, where it lands in the shell history and the process list (Operating a site). For scheduled jobs use the client's option file or your secrets store, readable by the backup user only.

Checklist

  • To do: The backup command of the site's engine is scheduled and owned by a named team.
  • To do: SQLite is backed up with .backup, never by copying the live file.
  • To do: The copy is checked (PRAGMA integrity_check, a test restore).
  • To do: No password appears on a command line or in a crontab.
  • To do: The dump and the file backup are taken in the same window.

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