Posted in Wordpress on May 30, 2016
Migrating a wordpress site maybe tricky. Luckily, we offer free migration services for all of our customers for the first time they are using Whost.
But if you would like to do it by yourself, here are the steps:
Step 1. Download all files
FTP to the server which you want to migrate. Download all the files.
Step 2. Export the Database
Login to the phpmyadmin of your old server. Export the whole database out into a .sql file
Step 3. Add the domain to Whost
You can add/ edit/ delete your domain easily inside Vesta Control Panel. Go to 'web' inside your Vesta Control Panel, then you can manage your domain.
You can just add a domain in Whost at the moment, but keeping your domain pointing to the old server at the moment so people can still see your website during the migration.
Step 4. Upload the files to Whost
FTP to Whost and upload all the files. After you add a domain in Vesta Control panel, a folder for your domain will be created automatically under the folder 'web'. So, you should upload all the files to 'web/your_domain/public_html'
Step 5. Create and import the database to Whost
Create a database in Whost. You can check out the post:
Go to phpmyadmin, and click 'Import'. Upload the sql file you exported before.
Step 6. Ammend wp-config.php for the new database information
You can FTP to your Whost server now and look for wp-config.php, which should be located in the root folder.
Change the DB_NAME, DB_USER, DB_PASSWORD to your new database information. 'DB_HOST' should always be 'localhost' in Whost
Step 7. Point the domain to Whost
Wait for 2-24 hours for the DNS propagation.
Step 8. Use searchreplacedb2.php to change old domain information in the database
If you are not changing the domain, no need to do this step. This step are only for those who the web domain is also changed rather than just changing server.
Downlaod searchreplacedb2.php from https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
The purpose of using this script is to change all the old domain string in the database to the new domain.
Upload searchreplacedb2.php to Whost root folder. Run it on the browser: your_domain.com/searchreplacedb2.php
Follow the instruction:
Here you type the old domain in 'search for' new domain for 'replace with'
After that, hit run. Remember to delete this file now!
Step 8. Login to wp-admin and update permalink setting
Just login to wp-admin, go settings->permalinks, choose a link structure and click 'Save Changes'. This step will make sure your wordpress website regeneate the .htaccess file.
That is! All done!