In this tutorial I will explain how you can transfer your wordpress site from one domain to another. I’ll assume you are using cpanel web hosting.
- Login to your cpanel hosting and go to File Manager and select all the wordpress files and then click compress to create a backup (backup.zip) of your wordpress site.
- Download the backup.zip file by going to yourdomain.com/backup.zip
- Then go to phpmyadmin and on your left click on the database name and then click Export. Select Custom Export Method and choose Output “Save output to a file “ and then choose Compression “zipped or gzipped” and click Go. This will download the compressed database/mysql dump file.
- Extract the database file and then open it with an editor (e.g notepad++) and press Cntrl+H to replace all the occurrences of domain with the new domain name.
- Now login to your new hosting’s cpanel (If the new domain is hosted on the new hosting)
- Under Databases click on MySQL® Databases and create a new database for the new domain, Add new database user and then add that user to that database.
- Then go to phpmyadmin and on your left click on the new database that you created and click Import and then click Choose File to browse for the mysql file and then click Go. Database will be imported.
- Using ftp (Filezilla) upload the wordpress files (backup.zip) and then using File Manager in Cpanel, extract the zip file. You are in public_html folder, so when you will extract the zip file it will create a new folder backup in public_html so open this folder and move all the contents of this folder to public_html folder. If you have added the domain as an addon domain then move the wordpress files to its respective folder.
- Update the wp-config file with the new database details (database name, username and password)
- You are done with moving your wordpress site to a new domain