Global Moxie

http://globalmoxie.com/blog/big-medium-backup.shtml

Automate Site Backups with Big Medium

With Big Medium 2.0.4, your favorite neighborhood CMS learned how to back up its own data. Learn how to use this new feature.

By

With the release of Big Medium 2.0.4, your favorite neighborhood CMS learned how to back up its own data, taking compressed snapshots of itself on a regular schedule.

For the moment, however, this is a “hidden” feature that is turned off by default. Big Medium knows how to make backups, but it doesn’t yet know how to automatically restore those backups to put Humpty Dumpty back together again. This means that restoring from backup requires you to uncompress the backup files and move directories around under the hood. It’s not terribly difficult work, but it’s just complex enough that I consider the backup feature a tool for advanced users. Until I get around to adding a “restore from backup” feature and a control-panel interface for managing backups, the feature is off by default.

Want to turn it on? Here’s how.

Requirements

The backup feature requires that your server knows how to make zip or gzip archives. If your server is Unix-flavored, you’re almost certainly good to go. If you’re running a Windows server, your hosting company or server admin may need to install the zip and unzip applications.

Here’s a quick way to check if your server has the necessary know-how: Go to “Library>Document Library” in Big Medium and then click “Batch upload.” If there’s a “Zipped” tab on the next screen, your server knows how to zip/unzip files.

Flip the switch

To turn backups on, open the moxiebin/bm-setup.pl file in a text editor. Locate these three lines:

'BACKUP_FREQ' => '1',
'BACKUP_HOUR' => '2',
'BACKUP_KEEP' => '0',

Change these settings based on your backup predilections:

So, to make daily backups at 2:00am and keep backups for five days, you would use these settings:

'BACKUP_FREQ' => '1',
'BACKUP_HOUR' => '2',
'BACKUP_KEEP' => '5',

Or, to make weekly backups at midnight and keep backups for four weeks:

'BACKUP_FREQ' => '7',
'BACKUP_HOUR' => '0',
'BACKUP_KEEP' => '4',

After making your changes to moxiebin/bm-setup.pl, Big Medium will start making your backups at the appointed hour.

So where are they?

Big Medium stashes its backups in the moxiedata/backups directory. Each backup snapshot is named with the date and time when it was made (e.g., 2008.08.28-02.01.05). Inside are three more directories (moxiedata-files, public-files and bmadmin-theme) which contain compressed archives of data files, image/document files and custom themes respectively.

For instructions on how to use these compressed files to restore a backup, check out these instructions: How do I restore a Big Medium installation from backup?

Tags: