How To Copy Your WordPress Database

DIY / Tech April 29th, 2008

repost from:
http://ageeksjourney.com/wordpress/how-to-copy-your-wordpress-database/

Export the Database

This is best done by using the Database Backup Plugin. Download and install it in your online blog. Export everything except the optional tables and set it to download the backup to your Desktop.

The plugin exports the data into an SQL file. If you have used images or videos in your posts then you will have to use Filezilla or your favorite FTP program to download your upload folder to the WOS folder on your Desktop.

Now you cannot import this SQL file into the local WordPress
database as it is, because all of the links in it will still be
referring to your online blog. The database backup
has been downloaded as a gz type file, unzip it with winzip. This will
give you a file that can be editted in a text editor. I use Notepad++ a free replacement for Notepad.

Open the SQL File in a text editor such as Textpad. Use the Find/Replace option to replace your website URL with your WOS URL.
My blog’s URL: http://ageeksjourney.com
WOS URL: http://localhost/wordpress

If you are following along in this series you will use the same WOS
URL, but change the blog URL to the one that you use. Then save the
file.

Import the Database

  • Start WOS, then go to http://localhost/phpmyadmin/
  • In the side bar click once on the WordPress database.
  • You will see a horizontal set of tabs, click on Import
  • Click on the Browse button and select the modified database file that you created. Then click on the Go button.
  • Copy the Upload folder from the WOS folder to the same location in your local blog (usually at:
    FLASHSTICK:\www\wordpress\wp-content\)

Wrapup

If everything went well, you can now go to:
http://localhost/wordpress/
and you will see all your posts and comments that are on your online
blog. This will give us something to work with when we start modifying
or creating themes.

Note: The local mirror of your blog will now have the same username and password as your online blog.

Leave a Reply