How to Transfer a WordPress Blog to a new Server or Web Hosting
I have been seeing many queries and requests about transfer / migration of a WordPress blog installation from one server to another server or web hosting account from different webmasters.
There is an increasing demand for a dependable and detailed tutorial for the same. Hence I decided to create a detailed tutorial with screenshots and steps that will clearly explain on how to migrate an already established WordPress blog to a different web hosting server without any issues.
- OLDserver – The server on which the blog is already installed on.
- NEWserver – The destination server of the new target web hosting company.
- OLDdatabase – The database file of the original blog.
- NEWdatabase – The database of the target blog.
A High level view of the procedure:
- Backup the FTP files and folders to your local machine from the OLDserver.
- Take a backup of the WordPress Database to your local machine from the OLDserver.
- Create a new Database on the NEWserver
- Import the OLDdatabase file to the freshly created NEWdatabase
- Update settings on the NEWdatabase.
- Upload the files and folder to the FTP of the NEWserver.
- Edit the Wp-config.php file to ensure database and user details are correct.
- Change the Name server of the domain to the new hosting.
- Test your website features.
STEP 1: Download the Files and Folders from your FTP to your local computer
You could either use a FTP client like FileZilla or directly download the Files and folder of your WordPress blog installation to your local computer. Please note that you should be downloading all the files, folders and the entire content of the folder where your “WordPress blog installation” resides in.
STEP 2: Download the original database from the OLDserver
This is the second step wherein you should download or export the OLDdatabase file to your local computer. Once you are logged in the OLDserver control panel, locate the phpMyadmin icon and click on it.
Click on the database that we need to export / download on to the local machine as show in the image and further click on the “Export” tab on the right hand side as show in the next screenshot.
Settings for database export: The below boxes needs to remain checked as shown in the screenshot. Once the settings are all fine, enter a name for the export file (any name of your choice) and please click on the “Go” button to proceed for the export. Save the file.
Great! Now you are done with everything you need from the OLDserver. Good job!
STEP 3: Import the FTP files to the NEWserver
This should be an easy task for you, upload all the files through your FTP client or webhosting control panel of your NEWserver and make sure the size of the backup and the migrated files are matching.
Step 4: Import the Database to your NEWserver
To start off, we will have to first create a new database, new database user and assign privileges on the NEWserver. This task is divided as below:
- Create fresh database on the NEWserver
- Create new database user on the NEWserver
- Assign “All privileges” for the new DB user on the NEWdatabase created.
- Import the OLDdatabase to the NEWdatabase.
Create the Fresh database on the NEWserver from the control panel and follow the below screenshots to create a new user and further assign the privileges to the new user created for the database access as shown in the images above. Also take a note of the new database name and new database user name to use later.
Importing the OLDdatabase into the freshly created one
Again access the phpMyadmin on the NEWserver and select the fresh created database and proceed to the “Import” tab as shown in the image and simply import the old database to the new one. This might take some time depending on the size of your database.
Once your database file is imported, it will give a confirmation message saying “N number of queries successfully executed”
Important change to make after importing the OLDdatabase to the NEWdatabase
You would need to make 3 checks as show in the screenshot and edit the WP_Options table value to the correct one. Here most case you would only need to edit the Upload_Path value as it will change with the change of host.
Only field you need to replace from what is shown in the screenshot is – replace “usedms4n” with your Cpanel login name or database name prefix that is auto created.
Now before we call if completed, Final Step: Browse to your WordPress blog folder and edit “WP-config.php” file and make change the database name, database username, database password to the freshly created database and users.
Good Job! Now you are done with the database and File import. If you haven’t yet redirected your domain name server to the new webhosting name server, do that now and your migration is complete. Test all the features to find make sure it works great.
Feel free to drop a comment with your question and I will try my best to help you out resolving your issues.