Here are the steps to migrate WordPress site to a new host/domain.
Table of Contents
Step 1: Backup your files
Click here for our guide on how to take a files backup.
Download the files backup at a safe location and proceed to the next step.
Step 2: Backup your database
Click here for our guide on how to take a database backup.
Step 3: Create Database on the New Host
Click here for our guide on how to create a new database
Make sure that you write down the database name, username and its password. You will need them in the step 5.
Step 4: Import the database
Click here for our guide on how to import a database. If your old database is bigger than what you host allows you to upload, try gziping the sql file. phpMyAdmin allows you to import gzip files.
Step 5: Edit the wp-config.php file
In the files that you downloaded earlier, open wp-config.php using a text editor like Notepad++. Find and edit the following values with the database details from step 3.
define('DB_NAME', 'new_database_name'); /** MySQL database username */ define('DB_USER', 'new_database_username'); /** MySQL database password */ define('DB_PASSWORD', 'new_database_password');
Step 6: Upload files to the new server
Upload the files you downloaded in step 1 with the updated wp-config.php file from step 5 to the new server.
If you have done all the steps correctly, your new blog should be up and running.
Additional step: If you are moving to a new domain
Incase if you are moving the site to a new domain, you need to search for all instances of the old domain name in the database and replace it with the new one. You will find at least 2 instance of the old domain in the wp_options table. Make sure you don’t miss any.
Additional step 2: If you are moving to a new domain
Make sure you let the search engines know about the new domain. You can create a 301 redirect from your old domain to the new one. Click here for our guide on how to do a 301 redirect.