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

Take a backup before a change

Step by step - take a consistent backup of database and files right before a change, inside the maintenance window, with the right tool for your database engine, and check that the files are complete.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/tasks/operations/take-a-backup-before-a-change.md

On this page

Take a backup before a change

This task is for administrators before an upgrade, a migration or any change that touches the database. At the end you have a database dump and a file archive taken at the same moment, which is your rollback. Background: What to back up.

Contents

  1. Before you start
  2. Steps
  3. Check it worked
  4. Pitfalls
  5. Related pages

Before you start

  • Shell access, the database user and enough disk space on another volume or system.
  • Know your engine: grep -rn "DatabaseImplementation" settings/override settings/siteaccess/*/site.ini.append.php settings/site.ini.

Steps

  1. Switch maintenance on, so database and files match (Take the site into maintenance for an upgrade).

  2. Dump the database (the client asks for the password; never type it on the command line):

    EngineCommand
    MySQL, MariaDBmysqldump --single-transaction -u USER -p DATABASE > backup-before-change.sql
    PostgreSQLpg_dump -U USER DATABASE > backup-before-change.sql
    SQLitesqlite3 var/storage/sqlite3/exponential.db ".backup 'backup-before-change.db'" (your file name)

    Other engines: Backups per database engine.

  3. Archive the files:

    tar czf backup-before-change-files.tgz var/storage settings/override settings/siteaccess extension design
  4. Copy both to the backup location, off this server.

On MySQL or MariaDB sites with the git_manager extension, Setup > Backup, Create full site backup is an alternative from the browser; its archives stay on the same server until you move them (Backups from the admin with git_manager).

Check it worked

  • The dump ends normally (for MySQL the last line is a -- Dump completed comment) and has a plausible size.
  • tar tzf backup-before-change-files.tgz | head lists the files.
  • Note the file names and sizes in the change record.

Pitfalls

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