Website migration from one host to another host is always headache problem for a website owner. Because no one wants their site to be a problem. When we choose a new host, the first thing that comes to mind without any problems and without loosing any content how to migrate site to new web host.
Many times people pay to professionals for move their site to new host. If you have a little knowledge, you can easily move the site to another host. Here I am sharing my Experience. That’s how I moved my site to host-gator. So how you can move your site one host to another without any problem. Follow these easy steps below-
1. Backup Database via CPanel?
First backup your Database, Login to your CPanel account & click on Backup Option.
In Backup Download a MySQL Database Backup, to download click on the database link & save file on your computer.
2. Backup files-
After download a backup database, this time for download all of your WordPress files along with the content folder. For this in the CPanel click on File Manager option. A pop box will appear- File Manager Directory Selection. Now Select Document Root for radio button, Tick Show Hidden Files (dotfiles) & hit Go button.
Now you’re in Public_html directory. Here click on Select All from top-bar & after this right click & click on Compress from the context menu.
A popup box will appear, select Zip Archive or Tar Archive radio button after this click on Compress File(s) button.
Now it will compress all files in public_html directory & create a zip file, download this zip file on your computer.
3. Create a new database, user & password on new host-
- Now go to your new webhosting CPanel account, after login click on MySQL Databases option.
Create a new database.
Create a new user with a good password.
After creating new database & new user, Add this new user account to the new database.
And grant it All Privileges.
Please be noted that the database, user & password you have created here. You’ll need this database name, username & password in Wp-config.php file. So copy it to a safe place.
4. Import Sql database via phpMyAdmin
- Now time to restore database click on phpMyAdmin option in new web host CPanel account and select your new database from the list on the left sidebar, which you have created above. After it opens click on the Import tab from the top menu.
- In the File to Import section click the browse button and select the SQL file which you downloaded before in your PC.
- Before uploading Untick the Partial Import check box, make sure the format is set to SQL and then hit the Go button. The database import will now begin.
Wait for few moments. After import you will receive a success message.
5. Upload files
- Now click on File manager in new host CPanel & go to public_html directory, as you did before.
- Click on Upload from top option. On next click on Browse button & Now upload the zip file, which you downloaded in your computer.
Now wait until the file uploaded completely. It will take one hour or one day depending on your file size & network connection.
When the file to be uploaded then right click on file & click on Extract option. Now it will restore all files in Public_html directory.
6. Edit wp-config.php file-
- After restoring all files, now time to edit wp-config & add new database name, new user name & password. To edit wp-config file right click on wp-config in Public_html directory & choose Edit from the context menu.
A popup box will appear then click on Edit button.
Now replace the old database name with your new database name.
Replace your old user name with your new data user name.
Replace your old password with your new password.
After changing database name, user name & password, save WP-config file by clicking on top right corner save button.
Now replace your old name servers to new name servers, which you are using with your domain name. After changing wait for 1 or 2 days because full migration process takes 24 hours to 48 hours, then the site will successfully moved on new webhost.
Please don’t delete your wordpress installation on old web host, unless your site was not fully functional.
That’s it! now you have successfully moved your files to new webhost.