[wp-hackers] Tips for moving a Wordpress install

Mike Schinkel mikeschinkel at newclarity.net
Tue Dec 1 20:55:02 UTC 2009


Dump the database to a SQL file.
Search for the old domain name prefixed with "http://" and replace with the new domain name also prefixed with "http://". 
Create a new database with the same name on the new server and import the modified SQL file.
Create a database user with the same name and password, and give it appropriate rights to the database.
Upload all files (PHP, CSS, images, etc.) using FTP from local into a directory mirror on your hosted server.
Done.

Note:
-- If you can't create a database and user with the same name and password, modify wp-config.php found in the website's root.
-- The search and replace *could* cause a problem if the domain name somehow matches incorrectly, but very unlikely.
-- You might also want to add two defines in wp-config.php, see http://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php

HTH.

-Mike Schinkel


On Dec 1, 2009, at 3:41 PM, 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.
> 
> 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.
> 
> //Christian
> 
> 
> 
> 2009/12/1 Harish Narayanan <harish.mlists at gmail.com>
> 
>> Christian Gundersson wrote:
>>> Hi,
>>> 
>>> 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
>> inserting it.
>> 
>> 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.
>> 
>> Harish
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list