Move WordPress Site from one Server to another Server
This tutorial will show you how to move WordPress Site from one Server to another Server, (which can also be from the local host to the Live Server)
You must achieve the following requirements below before you proceed to move WordPress Site from one Server to another Server.
- Have a web host that supports WordPress
- An FTP program to help you transfer files from one server to another. I will recommend FilleZilla, you can download from here
If you are fully equipped on the above requirements, then you can go ahead and perform the steps below:
1. Export the WordPress database: Exportation of your WordPress database can be done using phpMyAdmin. phpMyAdmin allows you export your WordPress database,
- Simply go to www.yoursite.com/phpmyadmin
- Click on your WordPress database
- Then you click on export from the top menu bar (As shown in the Screenshot Below)
In the Export method perform the following actions;
- Choose custom to produce more options
- Select all tables
- Choose gzipped to enable file compression
Scroll down to the bottom of the form and click ‘Go’ to download your database
2. Move Files from old site to new site: If the files are stored on your local host then you may use an FTP tool (File Zilla), to transfer the WordPress files from localhost to live server. Ensure you upload all files and folders to the ‘www’ folder of your live server directory
3. Create MySQL Database on Live Site: Here you will have to access the cpanel of your live host, you will then access the MySQL database by clicking on its icon found in the database section
Clicking the icon will take you to another page, on that page, create a new database
After creating a Database, scroll down and create or add an existing user to the database, afterwards you then set administrative privileges for the user. You need to grant all privileges for this user.
4. Import Exported WordPress Database to Live Site: You will also need to import the exported database to the live site, to achieve that you will need to:
- Go to your cpanel and click the phpMyAdmin icon
- In phpMyAdmin, click the database you created earlier
- Click the import tab at the top menu
- Click on the choose file button and select the gzipped file you exported earlier,
- Press ‘Go’ at the end of the form and phpMyAdmin will import all WordPress database to this live server
5. Changing the site URL: To fully setup your live site, you need to change the URL of your site, because WordPress will still register the site in your former domain, you need to update the database to reflect your new Domain.
Look for the wp-options table from the database that has just been imported. Click the table and you will see the siteurl, click the edit icon and change the value of siteurl to your current domain name
Save the field by clicking the ‘Go’ button
You also need to the perform the above step on the home column, edit it to your own domain name and click the Go button
6. Setting up the live site: After successfully importing the Database and uploading all WordPress files to the live site. You will also need to update the wp-config.php file. The new details you will provide are the database name, user and password you created earlier.
Login to your WordPress admin panel, and go to Settings » General. Click save Options. This will ensure that the site URL is corrected anywhere else that needs to be.
Then go to Settings » Permalink and click Save to ensure that all post links are working fine
7. Fix Images and Broken links: For those who want to do it via SQL, here is a simple SQL query that should solve this problem:
UPDATE wp_posts SET post_content = REPLACE(post_content,'localhost/test/', 'www.yourlivesite.com/');
Simply go to phpMyAdmin, click on your database and then click on SQL from top menu. Copy and paste the above query but don’t forget to change ‘www.yourlivesite.com’ to your own live site URL.
Hope this tutorial has helped to move WordPress Site from one Server to another Server.
Any Questions? Please leave a comment below