July 19, 2004
Backing Up Your Blog
Occassionally databases get corrupted, servers fail or web hosts go out of business. So it's a good idea to back up your Movable Type blogs. There are many methods for doing so, a few of which I will cover here. The back-up process is much easier if you are using MySQL as your database, which, by the way, is one good reason to use MySQL over the default Berkeley DB.
TypeMover is a new plugin for the purpose of backing up, restoring, and/or migrating your Movable Type weblog. It is compatible with MT3 and later versions of Movable Type. From the TypeMover website:
TypeMover is a MovableType plugin. It adds backup, restore and migration features that let you get your data in and out of your servers.
The existing Import/Export functionality included in MT is very limited. It only includes the most basic content, it is very slow, and it is very easy to make mistakes and import your data too many times.
TypeMover backs up and restores all your weblog data, including settings, templates, categories, authors, notification subscriptions, trackbacks and pings.
It is also faster and safer.
You can use TypeMover to backup any MT server you have FTP access to, and to restore any backup into the server TypeMover is running on. You can't backup a server without having FTP access, even the server where TypeMover is running
Backing up your MT blogs with MySQL
If you have chosen MySQL as your database for your MT install you can easily back-up the entire blog - entries, comments, authors, templates, etc. - with a simple MySQL "dump" command. The dump command will create a large "dump" file that will have all of the data from your database in it that can be used to easily restore all of your weblogs. To do this you need either command line access to your database or phpMyAdmin installed on your server. The instructions for the dump command and phpMyAdmin can be found in the MT 3.2 User Manual. You can also find instructions for the dump command at MySQL's website. All that said, phpMyAdmin is not installed on my server and I could not get the dump instructions on the MTWiki to work. So I ended up needing some handholding from tech support from my web host. The dump command that ultimately worked on my server was a little different than what is written on the Wiki. Tech support also set up a "cron job" for the server to automatically create a dump file, backing up all of my blogs every night. Every few days I FTP into my server and download the dump file to my desktop, so I have a local copy of the database.
Backing up your MT blogs if you use BerkeleyDB or MySQL
If you are using the default database that comes with Movable Type - BerkeleyDB (or if you are using MySQL and don't have phpMyAdmin and don't want to deal with Unix commands) - the back-up process is a bit more involved. The three elements of your weblog installation that you want to back up are a) the entries with their comments, b) your index and archive templates, and c) your weblog configurations for each of the weblogs that you have on your MT installation. If you are using BerkeleyDB you can download a copy of the db file in binary mode but this won't be useful if you ultimately upload it to a server with a different version of BerkeleyDB.
1. Export your entries.
Using MT's export function you can export all of the entries for a particular blog, and their comments. In MT Weblog Edit, click "Import/Export" from the menu at the left. If you are on a Mac, hold down the "option" key or if you are on a PC hold the shift key. Next (while holding the option or shift) click the link, "Export Entries From yourBlogName" and you can save the export. The resulting file should be saved as a .txt file. If it shows up as "mt.cfg" don't worry - just change it to somethingmemorable.txt. Check the file and make sure the export worked and you have a text file with the data from all of your entries.
If you have multiple blogs on one MT installation, you can follow the above instructions for each weblog. Or you can create an Export Blog that will more easily automate the export process. Instructions for how to create an Export Blog can be found here at the MTWiki. The process is straightforward, requiring the creation of a new "back-up" weblog, the installation of the MTOtherBlog plugin, and the uploading of a rebuild.cgi file.
2. Back up your templates.
Using an FTP client, create a templates folder in the same directory of the index file of each of your blogs. In MT Weblog Edit, for each blog that you have, go to the manage templates section. Template by template, create a backup template by inserting a file name into the �Link this template to a file� window. For example, for your main index template, type in templates/mainindex.tmpl. Rebuild your files. This tip comes from MT forum moderator Girlie (Shelley) and can be found in detail at http://www.thegirliematters.com/tips/archives/0207/back_up_templates_with_link_this_template.php
You can also output your templates using MySQL and PHP.
3. Record your weblog config preferences.
For each weblog, click the "Weblog Config" button in the left-hand menu. For Core Setup, Preferences, Archiving and IP Banning, record your current settings by printing them out. Some printers don�t fill out the check boxes when printing, so check your check boxes on your printouts for future reference.
Multiple Blog Suite is a set of scripts you can use to help back up your templates and configurations if you have many blogs.
MT Forum thread on backing up your weblog
Backing up your MySQL database
TypeMover - a plugin to help you backup, restore, and migrate your Movable Type weblog.
Creating Automatic Backups of your MT Database
Has this tutorial been helpful? Please consider linking to Learning Movable Type at http://learningmovabletype.com/ . Thanks!
If you would like to send a trackback
please use the following URL: http://learningmovabletype.com/cgi-bin/mt32/mt-tb.cgi/294
Using Movable type, the site is based on a MySQL database, and it's important to back this up. Therefore I've put the following commands into crontab - I think they're okay (if anyone spots errors, please let me know!) The......[read more]
Tracked: September 6, 2004 11:47 AM