mod_backup

mod_backup serves two different purposes: it makes a nightly backup of your files and database, and can also backup/restore individual resource items.

Daily backup of database and files

Losing data is bad for business. This applies to your customers as well if you are building sites for them. It is critical to keep backups of any Zotonic sites you develop.

After enabling mod_backup, it will make a backup of the site’s data every night at 3 AM. It keeps the last 10 copies of the data, so you have alway a backup to roll back to.

The backups are stored under backup in the files directory of your site. Check in the admin under System > Status to see where the site files directory is located.

The site’s media files are stored as a .tar.gz file, while the database is stored as an uncrompressed .sql file.

We advise to add a cron script to the server for copying the data to remote storage.

Per-resource backup/restore

Edit on GitHub

Models

m_backup

Not yet documented.

m_backup_revision

Not yet documented.

Controllers

controller_admin_backup

Shows the admin backup screen where you can download nightly backups that were made by mod_backup.

controller_admin_backup_revision

Shows the admin backup revisions screen where you can see older version for a resource.

Dispatch rules

backup

Dispatch rules Name Path Resource Args admin_backup [“admin”,”backup”] controller_admin_backup [seo_noindex]…

Actions

backup_start

Action which starts a manual backup.

Referred by

Restore/upgrade content db from backup

Contributed by: Scott Finnie

controller_admin_backup

Shows the admin backup screen where you can download nightly backups that were made by mod_backup.

mod_admin

Extending the admin menu See m_admin_menu on how to extend the admin menu.

All dispatch rules

All the dispatch rules from all modules. For a background on dispatch rules, see The URL dispatch system.

m_rsc_gone

This model tracks deleted resources (see m_rsc). Its primary goal is to be able to determine if a resource never…