The Movable Type User Manual

NOTE: This documentation is for Movable Type 3.2. If you are using a newer version, please see the documentation for Movable type 3.3x or Movable Type Enterprise.

« Backup/restore your SQLite database | Up | Site URL »

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.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.