[wp-hackers] Tips for moving a Wordpress install

Harish Narayanan harish.mlists at gmail.com
Tue Dec 1 20:55:13 UTC 2009


Christian Gundersson wrote:
> I've looked at this alternative, but as you mention in step 4 there will be
> search and replacing since WP itself inserts absolute paths in posts when
> you insert an image from media library.

I don't use the media library, so I did not know this. I don't think
absolute paths in the posts is a good idea (at the database data level,
anyway).

> And to answer Mikes question, almost all cases I'm interested in will be
> moving from a local development platform to a public site which means that
> the domain name/siteurl will change.
> 
> I was hoping that there would be a less cumbersome way of doing this step.

There is nothing cumbersome about these steps. It takes a matter of a
few minutes in total.

1. mysqldump --opt -uDB_USER1 -p -h DB_HOST1 DB_NAME1 > my_db_file
2. scp username1 at foo.com:~/path/to/wp username2 at bar.com:~/new/wp
3. emacs wp-config.php
4. sed -i 's/foo/bar/g' my_db_file > my_new_db_file
5. mysql -uDB_USER2 -p -h DB_HOST2 DB_NAME2 < my_new_db_file
6. Celebrate your site going live!

Harish


More information about the wp-hackers mailing list