Archive for the ‘Databases’ Category

Importing old Wordpress blog content into a new instance of Wordpress

Thursday, August 3rd, 2006

I finally managed to do what was said to be the �impossible�. I imported all of our own blog content into a new instance of Wordpress, automatically.

ShellA is the terminal where the old wordpress instance resides, ShellB is the terminal where the new wordpress instance resides.

shellA> mysqldump -u USERNAME -p DBNAME TABLENAME > FILE.OUT

shellA> scp FILE.OUT USERID@NEWHOST.COM

shellB> mysql -u USERNAME -p DBNAME < FILE.OUT

In the event the posts table name has deviated from the standard wp_posts naming convention, do this:

mysql> use NEWDBNAME;

mysql> drop table wp_posts;

mysql> create table wp_posts as (select * from OLDTABLENAME);