[wp-hackers] Tips for moving a Wordpress install
russgilbert at gmail.com
Tue Dec 1 20:38:37 UTC 2009
if you're going to have the same URL on your new server, but it isn't live
yet and you don't want to have to deal with a search/replace that then needs
to be undone, you can set your machine to treat the new setup like it was
the old by making a change to your hosts file.
On a windows box, that's in c:/windows/system32/drivers/etc, and on a mac
Put in the domain (www will need to be on a separate line) and the new
site's IP address, save the file, and close all open browsers.
Until you change the hosts file back, your computer will treat the new IP as
though it were the real site. It's a great way to test configuration on a
new host before the domain points there.
Other than that, just go through the steps below.
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Harish
Sent: Tuesday, December 01, 2009 12:33 PM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Tips for moving a Wordpress install
Christian Gundersson wrote:
> I've been trying to find a good guide to moving a Wordpress installed site
> from one location to another, more specifically from one host to another.
> All guides I've found fail in one aspect or the other. Either they
> completely disregard moving the media library(an important part in many of
> my sites) or they move files but not metadata information.
> There is always the complete database backup option using phpMyAdmin but
> won't that screw with site urls etc?
> How do you guys move from a development install to a live install site?
1. Dump the database to a file.
2. Copy the entire file tree over to the new location.
3. Modify wp-config to match new domain/db details.
4. If you hard-coded anything like absolute paths into your data (e.g.
beta.foo.com/blog/2009/my-images/ instead of /blog/2009/my-images/), you
need to run a search and replace on your database dump file before
4a. Go to wp_options in the database dump and update the values for
'home' and 'siteurl.' (We've been through this a couple of times just
this last week.)
5. Reinsert the database contents in the new database.
wp-hackers mailing list
wp-hackers at lists.automattic.com
More information about the wp-hackers