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

Restore and restore tests

The restore procedure for an Exponential site step by step, how to run a restore test on another machine without sending mail or running jobs, and the checks that prove the restored site is complete.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/hosting/operations/restore-and-restore-tests.md

On this page

Restore and restore tests

This page is for the system administrators and support staff who bring a customer's site back from a backup, and for the people who prove, before anything goes wrong, that the backups can be restored. It answers: in which order to restore, what to clear and restart afterwards, how to run a test restore safely on another machine, and how to check that the result is complete.

"A backup that was never restored is a hope, not a backup" (10.9 Backups and restore). The emergency version of this page, for an incident, is the runbook Restore from backup.

Contents

  1. Before you restore
  2. The restore, step by step
  3. Checks after a restore
  4. A restore test on another machine
  5. What goes wrong
  6. Checklist

Before you restore

  • Agree what is restored. A restore brings the whole site back to the moment of the backup: content published since then is lost. For a single deleted page, look first at the trash and the older versions inside Exponential.
  • Back up the current state before you overwrite it, so a wrong restore can be undone.
  • Check the release. Restore onto the same Exponential release (and the same composer.lock) the backup was taken with. A database from an older release needs the upgrade steps afterwards (Upgrading customer sites).
  • Know the engine's restore command: Database backups per engine.

The restore, step by step

From 10.9, Restore:

  1. Maintenance on. Visitors get the 503 maintenance page while the data changes.

    php bin/php/maintenance.php on --message="Restoring" --allow-root-user

    Under Velocity also stop the server, so no worker holds the old database:

    php bin/php/console exp:velocity stop --allow-root-user
  2. Restore the database with the tool of its engine, and unpack the files over the installation (var/storage, the per-site storage, settings/override, settings/siteaccess, your extensions).

  3. Fix the owner and mode of what you unpacked: the files must belong to the site's user, or to the shared group (8.7 File permissions and ownership).

  4. Clear every cache and regenerate the autoloads:

    php bin/php/ezcache.php --clear-all --allow-root-user
    php bin/php/ezpgenerateautoloads.php -e
  5. Start Velocity, clear its response cache, switch maintenance off, and open the front page and the administration:

    php bin/php/console exp:velocity start --allow-root-user
    php bin/php/console exp:velocity cache clear --apply --allow-root-user
    php bin/php/maintenance.php off --allow-root-user

Under Apache or nginx with PHP-FPM there is no Velocity step; reload the PHP-FPM that serves the site if the code or settings changed (Deploying changes).

Warning

Run the commands as the site's user (or as root with --allow-root-user, then fix ownership). Files created by root in var/ cannot be replaced by the web server afterwards, and the site fails in odd places (12.3 Permissions and ownership).

Note

The maintenance state is the file var/maintenance.json. If a backup of the whole var/ directory was taken while maintenance was on, the restored site comes back in maintenance; php bin/php/maintenance.php off ends it.

Checks after a restore

CheckCommand or actionGood result
The site answerscurl -s -o /dev/null -w '%{http_code}\n' https://www.example.com/200
The administration answersopen /admin/user/login, sign inthe dashboard
VersionSetup > System information, or ./console exp:systeminfothe expected release; no failed check
Cachesphp bin/php/cache.php status --allow-root-userends in PASS
Audit trail./console exp:audit verify --allow-root-userexit status 0
Contentopen recent pages and an image; publish a test objectimages load, publishing works
SQLite onlysqlite3 <db file> "PRAGMA integrity_check"ok
New errorstail -n 50 var/log/error.lognothing you cannot explain

Sources: 10.11 Monitoring and health checks, Database support. When content moved between machines or engines, also compare the row counts of ezcontentobject, ezcontentobject_tree and ezcontentobject_attribute with the source (Moving a site to another database).

A restore test on another machine

A test restore proves the backup, the procedure and the time it takes. Do it "on another machine at least once and after every major upgrade" (10.9), and on a schedule you define for your service (Backup schedules and retention).

A restored copy is a full site with real user accounts and real e-mail addresses. Keep it from acting like the live site:

  1. Stop mail. Set the file transport on the test machine, so every mail is written to var/log/mail/ instead of being sent (Mail delivery):

    # settings/override/site.ini.append.php on the test machine
    [MailSettings]
    Transport=file

    Or keep the transport and set DebugSending=enabled with DebugReceiverEmail=<your test address>, which sends every mail to one address. A per-machine variant (settings/override/site.ini.test.append.php with EXP_ENV=test) keeps this out of the live settings (Settings per environment).

  2. Do not install the crontab on the test machine, or notifications, newsletters and content jobs run against real addresses. Run a part by hand only when you test it.

  3. Restrict access. Do not expose the copy on the public internet; it holds personal data.

  4. Restore, check, measure. Follow the steps and checks above and write down how long each took.

  5. Remove the copy when the test is done, including its database and files.

Tip

Record each test in one line: date, site, backup used, time to restore, result, who ran it. That line answers the customer's (and auditor's) question "do your backups work?" with evidence.

What goes wrong

Symptom after a restoreCause and fix
Pages show content from before the restorecaches still hold it: clear all caches and Velocity's response cache, after any FPM reload
Class ... not foundautoloads or vendor/ do not match: php bin/php/ezpgenerateautoloads.php -e, and vendor/ must match composer.json
Images missing, pages finethe files half was not restored, or from another moment than the database
Errors about missing tables or columnsthe backup is from another release: apply the upgrade steps
The web server cannot write var/owner or mode wrong after unpacking: fix them
SQLite .restore failsa writer held the lock, or a page size mismatch; use the file replacement described on Database backups per engine

Checklist

  • To do: The current state was backed up before the restore.
  • To do: Maintenance was on and Velocity stopped while data changed.
  • To do: Database and files come from the same backup moment.
  • To do: Owner and mode are correct; caches and autoloads were rebuilt.
  • To do: The checks above all pass.
  • To do: Test restores run on another machine with mail off and no crontab, and are recorded.

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