Monday, May 22, 2006

Database backup and restore

I prefer the WP-DBManager plugin (currently at 2.04 for WP2+) by GaMerZ over the default plugin by Scott Merrill (currently 1.7) that came with the download.

I have used GaMerZ older version for WP1.5.2 with a little trouble (see them here, here and most recently here) but I still managed backing up and restoring it over at a new url.    I have assumed this current version has improvement hence the below experiement.

I have a site here running WP2.0.1, installed the plugin there and backed up a database.

  1. Downloaded the sql file to desktop
  2. Search and replace all url of the old site with url of the new site, use something like EditPad Lite as NotePad may not work due to large file size.
  3. Change also the database name (which takes the format like xxxxxxxxxx_-_database_name.sql) in the file to match that of the new site, this assumed that you have installed and activated the plugin at the new site such that you can read the database name from the plugin page.
  4. Rename the sql file to match the database name of the new site.
  5. Restore it at the new site

No sweat, all done!

Don't forget below
  • You better have both sites having the same theme during backup and restore
  • Once restored admin login at the new site will be replaced with those from the old site
  • In order for any of your customized themes to work properly you have to manually transfer all theme and plugin files across from old to new site.
Why do I have to practice this again.    The recent failure at my hosting Site5 is quite annoying.   If they are naughty again I might have to quit.

No comments:

Post a Comment