Web-en

Move wordpress site to new domain

How to transfer wordpress site to new host

When changing host, or wanting to switch to a new domain, there are a few of acions to do on a wordpress installation in order to have it functioning again with the new configuration.

WordPress.com Create a free website or blog 

However, following this guide, it should be pretty easy to migrate wordpress site to new domain !

It is also how to copy a wordpress site from one domain to another, as the original site does not necessarily have to be deactivated.

cheap web hosting companies

The process can be summed up to these actions :

1 – Backup and restore wordpress site to new server,

2 – WordPress database migration,

3 – Link wordpress to domain.

1 – How to export wordpress site

First of all, using a FTP client, connect to the server, and download the whole folder containing the wordpress files. This action will take some time, depending on the local and the server connection speed, it might take up to a few hours.

FileZilla the free FTP solution 

Move wordpress site to new domain : wordpress export entire site
wordpress export entire site

While this action is ongoing, do not hesitate to perform the next step, the WordPress database migration.

The local folder should then contain all files, including hidden files like .htaccess (files with name starting with a dot are hidden files on Linux systems).

Move wordpress site to new domain : wordpress site backed up
wordpress site backed up

2 – Migrate database from one server to another

Go on the old server, open the wordpress database, and select the export action.

MySQL, open source relational database management system 

Move wordpress site to new domain : MySQL export wordpress site database
MySQL export wordpress site database

There, just make sure that the choosen format is SQL, and click export.

Move wordpress site to new domain : export wp database
export wp database

Depending on database size and server speed, a file should be available for download after a few minutes. It contains the wordpress export database, and should be saved on the computer.

Move wordpress site to new domain : Migrate wordpress database to new server
Migrate wordpress database to new server

3 – WordPress import mysql database

Now, on the new server, open the cPanel web hosting administration or other website administration tool, and find the MySQL Databases. Prior to importing the data, a new database, user, and user access to the database has to be setup.

cPanel, the hosting platform of choice 

Move wordpress site to new domain : MySQL databases on cPanel hosting
MySQL databases on cPanel hosting

Here, start by creating a new database, giving it any name.

Move wordpress site to new domain : Creation of a new database for the migration wordpress
Creation of a new database for the migration wordpress

Then, add a new user, with a good password – mix of letters, numbers, special characters. The password won’t ever need to be remembered, only copy and pasted once, so save it somewhere handy until like an open Notepad++ tab the next step.

Notepad++ free source code editor 

Move wordpress site to new domain : Adding a new user to MySQL databaseAdding a new user to MySQL database

And finally, add the user created to the database, with all access, as this user will be the administrator of the database for WordPress.

Move wordpress site to new domain : Assign user to MySQL database
Assign user to MySQL database

Now, open the MySQL database in Phpmyadmin, and go to the import option. This is how wordpress import database will happen.

Move wordpress site to new domain : wp migrate db import
wp migrate db import

Here, select the file that has been created before, make sure the format selected is SQL, and also uncheck the partial import box. This is especially important for big sites, as the script might sometimes take longer to import the database than it is allowed to run.

By unchecking this box, the script will not stop from importing data in case it reaches the timeout execution, which is what we want to do here.

And of course, start the database import operation by clicking OK.

Move wordpress site to new domain : wordpress import sql options in phpmyadmin
wordpress import sql options in phpmyadmin

After the sql import has been completed, a success message should be displayed in phpmyadmin.

Move wordpress site to new domain : Successful import sql wordpress
Successful import sql wordpress

4 – WordPress database website

Now that the database is setup, it is time to tell wordpress about this new database, by opening the file wp-config.ini on the local backup. As this file is located in the root folder, it was most likely one of the first files to be downloaded, and should be available even if the transfer is not over yet.

However, if this file is not yet available, simply wait for the transfer to be completed.

There, locate the following lines, and update the database name, database user, and database password with the values from the previous step in cpanel :

Move wordpress site to new domain : Update WordPress database settings
Update WordPress database settings

5 – Upload wordpress site

If the wordpress data has been downloaded from the old server, it is now time to start to upload local wordpress site to server, still using an FTP client.

Move wordpress site to new domain : Upload wordpress site
Upload wordpress site

This operation will most likely take as long as it took to download the data, so take your time and have a coffee =)

6 – Link wordpress to domain

If you are not changing the domain name, this step is not necessary.

However, if you are moving wordpress site to new domain, from one domain name to another, then all the links have to be updated, to show the new URL instead of the old one.

To do this easily, start with Search Replace DB.

PHP search replace tool to update strings in database 

Changing the website URL might be a difficult operation. In case of trouble, refer to the official documentation.

Changing the site URL – wordpress codex 
Transfer website cpanel addon domain

7 – How to transfer a wordpress site to another domain

It should now be done ! However, one step might be missing, which is to configure the new server to be accessible by the URL, which is made through DNS change.

This operation can take up to 24h to be visible, therefore be patient if the URL is not working yet, it might be because the whole internet doesn’t know yet about your new website.

This process, called DNS replication, might take time, until whole internet associates the address of the new website to its domain name.

Best web hosting for small business