Migrating a WordPress powered website is a frequent task these days due to the fact that WordPress is one of the most popular CMS in use today. One of the main issues to tackle in a WordPress migration is the handling of the Domain Name.
Migrating with the same Domain Name
Migrating your website without the need to change the URLs will make your migration a breeze. As a standard rule, all you need to do is move your files and WP database. Doing it this way, your site URLs will be preserved as well as the content. If for some reason the name of the database and/or database user is changing, then you will need to make these changes within the wp-config.php file.
So the summary is if you are moving to a different server or provider AND are preserving your domain name, all you need to do is move your files and database. If the actual database login is changing, i.e. database name, db username and/or db password then you will need to update your wp-config.php file within the appropriate sections.
Migration when the Domain Name changes
If you need to change your domain name, there are a number of additional concerns. When moving files to the new server, all references within the content contained in the WP database will be using your old domain name. This will cause broken links and even prevent your WordPress theme from displaying correctly. If you replace URLs in your database, this may cause issues with data serialization (some themes and widgets store values with the length of your URL marked.) When changing this, everything will fall apart. To avoid serialization, there are two options:
Perform a search and replace on the wp_posts table.
Use the Search and Replace for WordPress Databases Script to change safely all instances.
We will be posting more detailed migration tutorials for WordPress in the near future.