plugins/Backup/bin/backup.php does from a shell what the Backups page does, without the web server's limits: for cron, for archives too large to upload, and for servers that cannot run Omeka's background jobs. Run it as the web server's user from Omeka's folder:
php plugins/Backup/bin/backup.php <command> [options]
Progress goes to standard error; results to standard output. The exit status is 0 on success and 1 on failure, with the reason on standard error.
Commands
| Command | What it does |
|---|---|
create [--no-database] [--no-files] [--code] [--note="…"] |
Makes a backup (database and files unless left out; --code adds plugins and themes). |
list |
Lists the archives (id, status, origin, size, date, note) and unlisted ZIP files in the backup directory. |
add <file> |
Adds an archive: a name in the backup directory, or a path elsewhere (copied in). Checks it file by file. |
fetch <link> [--allow-private] |
Downloads an archive from a link and checks it. --allow-private allows private network addresses. |
restore <id> --yes [--no-database] [--no-files] [--no-safety] |
Restores an archive. --no-safety skips the backup made first. Prints what was done. |
link <id> --site=https://example.org |
Makes a download link and prints it. The site's address is needed because a shell does not know it. |
delete <id> |
Deletes an archive and its file. |
cleanup |
Deletes created backups beyond the number to keep. |
When the plugin folder is a link shared between installations, add --omeka=/path/to/omeka to say which site to work on.
Examples
Move a large site from the command line on both servers:
# old server
php plugins/Backup/bin/backup.php create --note="Move to new server"
php plugins/Backup/bin/backup.php link 7 --site=https://old.example.org
# new server
php plugins/Backup/bin/backup.php fetch https://old.example.org/backup-download/7/3f9a…
php plugins/Backup/bin/backup.php list
php plugins/Backup/bin/backup.php restore 3 --yes