Chapter 1: Installation and Upgrade
Backup/restore your BerkeleyDB database
Backing up your database is an essential part of a healthy Movable Type maintainance schedule and critically important any time you endeavor to upgrade your system.
Backup/restore via FTP
BerkeleyDB stores your database in a number of files within a particular directory that you've specified in the mt-config.cgi. You can backup your database by downloading the entire database directory in binary mode.
To restore the database, simply remove the current directory from the server and reupload the backup in binary mode.
Command-line backups
If you have shell access, you can make a dated, compressed copy of your database with the following command:
tar cvfz `date +%Y%m%d`_mtdb_bkup.tar.gz DBDIRECTORY
Just replace DBDIRECTORY with the path of your database directory. If you're in the directory containing your database directory, you can just use the directory name with no extra path information. For example, if your database directory is db:
tar cvfz `date +%Y%m%d`_mtdb_bkup.tar.gz ./db
Because the backup archive is dated, this is an excellent way to set up a cron job on your system to achieve regular backups.
Command-line restore
To restore the files from the archive, you execute the following:
tar xvfz ARCHIVE.tar.gz
...where ARCHIVE is the archive file that contains your database.



