How To Migrate WordPress from Shared server to Cloud hosting?
WordPress can be migrated from shared hosting to personal cloud environment without a downtime by using following simple steps.
Creation of backup
You should backup everything including all files as well as database from the existing server by using cPanel. Ideally you should backup images and plugins by creating an archive of wp-contents directory and then downloading the same.
Database backup can be executed by using backup wizard on cPanel. Backup MySQL database and save it in backup_db.sql.gz on the desktop.
Setting up cloud server
You can launch a droplet and follow the steps mentioned in the guide ‘initial server setup for Ubuntu 14.04’. After the initial setup of cloud you should ensure installation of LAMP stack.
After the setting up of cloud server as well as LAMP stack you should install WordPress.
Creation of virtual host
Apache virtual host creation can be achieved by creating a new file in ‘site available’ directory. Use the following command:
sudo nano / etc/ apache2/ sites-available/ your domain.com
By appropriately substituting your domain.com as well as user name you can add a virtual host for blog. In order to make Apache listen for your domain.com you should enable the virtual host by using a2ensite, an Apache utility. This should be followed by reloading the Apache server.
Uploading the backup files
Upload MySQL database and files on VPS by using SCP in a secure manner. Following commands need to be executed on your computer for further uploading to server’s home directory.
scp ~/Downloads/backup_db.sql.gz [email protected]_ip_address:
scp ~/Downloads/wp-content.zip [email protected]_ip_address:
Restoration of database
After server login, execute the following commands by using substitutions in appropriate places:
mysql -h localhost -u database_user -p database_name < backup_db.sql.gz
After responding to the request for entering your password, your database contents will be instantly imported to desired database.
Restoration of WordPress Content files
By simple extraction and using an unzip command you can restore plugins, media, and themes.
This should be followed by testing your blog and clearing your DNS cache.