
How to migrate a wordpress website from one server to another?
In this article we will explain how to move a website from one server to another.
This displacement can be compared to a transplant of an organ in the body. This is why you must first make sure it is compatible, and then transplant it, making sure that the connection with the other organs is made.
Why migrate your website from one server to another?
Several reasons can lead us to migrate a wordpress website from one server to another, below are some examples:
- Migration before going into production: between the different development, qualification, pre-production and production servers
- Migration from one production server to another for several reasons:
- First, dissatisfaction with the quality of service
- Then, dissatisfaction with the accommodation price
- And finally the dissatisfaction related to the support and the commercial relationship of the host …
- Migration in the event of a disaster from a backup to a new server.
Backup and transfer of website files
The wordpress website is made up of 2 main parts:
- Flat files
- A database
Migration of the content of a wordpress website consists in making a backup, or an export of these two parts of the existing server, to transfer them to the target server.
- Perform a backup by transferring all files from the WordPress website, using an FTP file transfer tool
- Export WordPress database via phpMyAdmin
- Create a new database in the new target server
- modify the wp-config.php file to reflect the new database and user access information
- Import the database export, performed in step 2.
- With the FTP tool, upload the backup of the WordPress files made in step 1 to the new server.
The complete content of your WordPress site, files and database, is now in the new web server. Except that your domain name still points to the old server. The last step then is to point the domain name to the new web hosting server.
Transfer the WordPress database via phpMyAdmin
With phpMyAdmin, first select the site database to transfer.
- Click on « Export »,
- Choose « Quick »
- Select SQL as the format.
- Save the file to your hard drive.
Now the contents of the database are saved to the hard drive. you must then create a target database, and import the content into the new database.
It is necessary to create a database in the new host’s server. Keep the name of this database, that of the host, as well as the user name and password of the database.
To import the content into the new database, go to phpMyAdmin in the administration domain. In the import section, select the database on your hard drive and start the download.
Edit the wp-config.php file
- Edit the wp-config.php file
You must modify the configuration data, to indicate the new database, with the name of the user and the password to access it.
To do this, first modify the wp-config.php file with a classic text editor. Then the file is in the directory at the root of the backup of your site.
- « DB_NAME »: The name of the new database
- « DB_USER »: The name of the user to access the database
- « DB_PASSWORD »:The password to access the database
- « DB_HOST »: The name of your database server
This information is available on the personal space of your hosting server.
Switch the DNS registration setting to the new web server
Once your files are transferred to the target web server, you must first change the DNS of the domain name to point to the target website.
The DNS configuration of the domain is then carried out in the customer area of the domain name provider (domain registrar). the providers of .ma domains are listed on the the ANRT, the national agency for the regulation of Telecom.
Once the settings have been made, you may have to wait up to 24 hours for the domain to propagate.
For the migration of a wordpress website from one server to another, the Wedigitalpro web agency has the experts and the tools to design, create, put into production and supervise the websites of very demanding clients.
Wedigitalpro offers to support you. Contact us to study your needs.