Warning: restoring overwrites the live database, files, themes and modules with the contents of the archive. This cannot be undone. Create and download a fresh backup of the current state first if you might need to go back.
Restore from the backup list
- Go to Admin > Backup and click Restore next to a complete backup. Confirm the browser prompt to open the preview.
- Review the Backup Details (filename, when it was listed and when the archive was made, the Omeka S version it was made on, size, checksum), any warnings, and the What will happen list. It names the database that will be overwritten and the
files/,themes/andmodules/paths that will be replaced, based on what the archive contains. - Under Restore options, untick any component you do not want restored. Only components present in the archive are offered: Restore database, Restore files, Restore themes and Restore modules.
- Type
RESTOREin the Type RESTORE to confirm field. - Click Restore Backup.
The restore runs as an Omeka S background job. The success message links to the job, and you can follow it under Admin > Jobs. Submitting the form without the exact word is rejected with Restore cancelled: you must type RESTORE (all caps) to confirm.
What a restore does
Before touching anything, the module recomputes the archive's SHA-256 checksum and compares it with the value recorded when the backup was created, uploaded or added. A mismatch aborts the restore.
The archive is then unpacked into the system temporary directory, and every file is compared with the CRC-32 checksum stored in the ZIP. If there is not enough free space to unpack it, or any file is damaged, the restore stops with Nothing was restored and the site is left as it was. The preview warns in advance when the temporary directory is too small.
While a restore runs it holds the same lock as a backup, so no backup can start until it has finished. Each selected component is then applied:
| Component | Effect |
|---|---|
| Database | Every statement in db.sql is executed through Omeka's database connection. Each table in the dump is dropped and recreated with its data. Tables that exist on the server but not in the dump are left untouched. |
| Files | The archive's files/ tree is copied over Omeka's file store. Existing files with the same path are overwritten; files that exist only on the server are left in place. |
| Themes | The archive's themes/ tree is copied over OMEKA_PATH/themes in the same way. |
| Modules | The archive's modules/ tree is copied over OMEKA_PATH/modules in the same way, including the Backup module itself. |
Nothing is deleted on the server side; restores add and overwrite only. The export/ folder is never imported. A line describing the restore, including which user ran it, is appended to backup.log.
Effects to expect after a database restore
- The dump includes the
omeka_backuptable, so the backup list reverts to what it was when the archive was created. The archive you restored from stays in the list, marked complete and dated when it was made, so it can be restored again. - Archives created after that are still on disk but no longer in the list. They appear under Archives in the backup directory on the Backups page; click Add to backups to list them again. See Adding Archives by FTP.
- Records whose archive is not on this server, such as records restored from another server's database, show file missing instead of Download and Restore. Delete them when you no longer need them.
- The dump also includes the
jobtable,usertable and all settings, so job history, user accounts and configuration return to the backed-up state.
Restore an archive from another server
Bring the archive into the list with Upload Backup, or for a large archive by copying it into the backup directory and clicking Add to backups, then restore it with the steps above. See Moving to a New Server for the full procedure and its caveats.
From the command line
# Find the record number
php modules/Backup/bin/backup.php list
# Restore everything in backup #5
php modules/Backup/bin/backup.php restore 5
# Database only
php modules/Backup/bin/backup.php restore 5 --no-files
# Files only
php modules/Backup/bin/backup.php restore 5 --no-db
The command prints the same dry-run summary as the admin page and waits for you to type RESTORE before continuing. There are no flags to skip themes or modules on the command line; they are restored whenever the archive contains them. See CLI Commands.