Suppose, you are migrating you wordpress installation from one server to the other. In this case, you might have a different database server, database username and password. You might also have a different domain name as well. A general scenario will be migrating you wordpress installation from your localhost (local installation on your computer) to any online server.
In this case, you need to consider few things to make the site working. You need to make changes in wp-config.php (present in root directory of wordpress installation) and some update in wp-options table of your database.
Changes in wp-config.php
I suppose that my database name is wordpress, database username is root, password is pass and database server name is localhost.
/** The name of the database for WordPress */ define('DB_NAME', 'wordpress'); /** MySQL database username */ define('DB_USER', 'root'); /** MySQL database password */ define('DB_PASSWORD', 'pass'); /** MySQL hostname */ define('DB_HOST', 'localhost');
Changes in database (wp-options table)
1) In wp-options table, search for siteurl and home in option_name column.
SELECT * FROM `wp_options` where `option_name` = 'siteurl' OR `option_name` = 'home';
2) Then edit the option_value column for the two rows with your current site url. I have supposed your current url as http://example.com. You can put your own url.
UPDATE `wp_options` SET `option_value` = 'http://example.com' WHERE `wp_options`.`option_name` = 'home' ; UPDATE `wp_options` SET `option_value` = 'http://example.com' WHERE `wp_options`.`option_name` = 'siteurl' ;






John
January 31, 2010
Thanks for the quick tip.
Richard
February 18, 2010
I’ve seen this quick method before. However, if you have hardcoded any URLs or images in post/pages, you need to update these also. This means opening the database in a good text editor and doing a search and replace for old URL and replacing with new URL. This applies if you have changed domains. There is also a plugin called search regex or something that allows a global search replace.