Moving your WordPress website to another domain is hectic if it’s not done properly some bug will arise and your website will be in trouble. Here you are going to learn a proper tutorial on the migration of WordPress website from one domain to another domain.
We are going see to step by step process of how to migrate a WordPress website manually.
Deactivate All Plugins
We would recommend you to deactivate all the plugins that you have used for this WordPress website which you are going to migrate because sometimes plugins might not work on the new domain.To deactivate go to the admin page Plugins -> Installed Plugins -> Mark all -> Bulk action -> Deactivate -> Apply
Backing up Databases and Files
Before making any changes to the website to take backup is always better, to backup WordPress data manually, log in to your phpMyAdmin, click on your WordPress database and select Export
Make sure that you are exporting in SQL format and select GO, now your file will be downloaded in .sql file.
Preparing your backup file to upload
Now we are going to upload the backup files, before proceeding it login to phpMyAdmin of your new host and create a new database.
Updating the wp-config.php file
Extract the WordPress Zip file folder that you have downloaded earlier, find the wp-config.php file and edit it.
Edit the lines by replacing it with your new hostname and save.
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
Uploading your Backup
Now, we have to upload the modified WordPress folder to your new host via FTP/SFTP.
To upload the backup database, log in to phpMyAdmin in your new host and click Import.
Updating the WordPress Home URL and Site URL
There are many ways to set your URL, we are going to learn how to do it manually.
To manually update the WordPress Home URL and site URL, login to your phpMyAdmin account, open WordPress database, click on the wp_options table and change the values of site_ URL and home column.
Reactivating All Plugins and Updating Permalinks
Now you have done everything to migrate your WordPress after everything works properly you have to reactivate the plugin that you have deactivated before backing up.
In order to that navigate to Plugins -> installed plugins, select activate from the Bulk action drop down and hit the Apply button.
In order to update permalink, go to Settings -> Permalinks, select your desired permalinks structure and Save Changes.
301 Redirection Setup
For SEO purpose and avoid the duplicate content penalty, you have redirected the old domain to your new domain using 301 redirects.
Open the .htcaccess file in your WordPress install folder and the rules as below.
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301, L]
That’s it, now you have migrated your WordPress domain from one server to another server and also redirected it.