Migrating wordpress site to a new host can be a nightmare to most people. But the truth is that its very simple if you can read this post completely. WordPress migration process won’t take more than 30 minutes. In this post, you are going to migrate wordpress site to a new host. Let’s begin!
Step 1: Create the Backup
If you already have the complete backup, you may skip this. if not, to easily create the wordpress backup, you can make use of a wordpress backup plugin. It saves time, trust me! Once you have downloaded the backup to your PC, you can move on to the next step!
Step 2: Upload files
If you are having a compressed backup file, you need to extract it and upload to your new server’s public_html folder. If you are going to install in a sub folder of public_html, you have to upload accordingly.
Step 3: Create Database and user in new host
You have to create a database in your host. Also create a database user for the database to work. I can show you how to create a database and database user in cPanel.
Our database is ready to import now!
Step 4: Import Database
I hope you have the database backup file with you. If you have taken the backup using BackUpWordpress Plugin, your database backup can be seen at the root folder with a .sql extension.
Note: If you want to change domain, you need to open the .sql file in notepad and find and replace all the occurences of old url to new url. for example. Do a Find & Replace of http://www.old-site.com to http://www.new-site.com and save it.
Go to cPanel home and click on phpMyAdmin under Databases. Once you are there, you can select the database from left side. Just click on your database on left side and it will be selected. Now click on Import button.
You can now choose your database backup file and click on Go button. the database will be imported.
Step 5: Configure wp-config.php file
once you have done it, you have to go to file manager and open wp-config.php that can be seen in root folder. You have to change DB_NAME, DB_HOST, DB_USER, DB_PASSWORD values to your newly created values.
define('DB_NAME', 'your-database-name'); define('DB_USER', 'your-database-username'); define('DB_PASSWORD', 'your-database-password'); define('DB_HOST', 'database-host');
Final Step: Point Nameservers
Once you have done it, you can change your domain’s nameservers to new server’s nameservers.
yaay! You are done! You just migrated your wordpress site to new server!