WordPress Migration From Shared To Cloud

You probably start your website hosting from a small shared hosting account. As your website grows, you will hit the limitations of shared hosting, and then you know it is time to consider moving to a better hosting environment like cloud hosting. Cloud hosting is more reliable, higher scalability, flexible pricing, better security, and performance. Find out why cloud hosting is better for your business.

In this article, you will learn the various ways to migrate WordPress site from shared hosting to cloud hosting

7 Steps to Migrate a Website

Generally, in order to move a website from one location to another, you will have to copy all of the data including files and database. There are many ways to do it, and here are the steps:

  1. Backup! Always keep at least a recent backup of your website before you do anything
  2. Export files from current website
  3. Export database from current website
  4. Create a hosting account on the new server
  5. Upload files to a new website
  6. Import database to the new website
  7. Update DNS records

At RunCloud, we have the migration service to migrate your website from the other web hosting server (shared hosting) to a RunCloud managed a server. It is free for the first web application!

If you would like to do it yourself, here are some methods to migrate your website from shared hosting to cloud hosting. We will use WordPress, the most popular CMS in the world, as an example.

1. WordPress Migration Plugin: Migrate Guru

migrate guru wordpress migration plugin

Migrate Guru is a WordPress migration plugin from BlogVault, a WordPress backup solution company. The beauty of Migrate Guru is that it is a free one-click migration plugin that supports unlimited sized websites, from 50MB or 50GB website.

The migration process works on their server, so it won’t overload your server. No extra disk storage is required. Your files are copied to their server and deleted after the migration is complete. It also automatically rewrites URLs, bypasses import-export scripts, and handles serialized data.

Requirements:
  • Migrate Guru plugin installed on existing WordPress site
  • A WordPress installation on new cloud hosting
  • FTP/SFTP access to new cloud hosting

How to use Migrate Guru to migrate WordPress site

  1. Click on Migrate Guru from the sidebar menu in WordPress dashboard
  2. Fill in your email address then click “Migrate Site
  3. On the new page, select FTP
  4. Enter FTP details, including destination site URL and directory path
  5. Click the “Migrate” button to start the migration
  6. Make a cup of coffee. You will be notified by email once the migration completed
  7. Enjoy your speedy site on new cloud hosting

2. WordPress Migration Plugin: All-in-one WP Migration

All-in-one WP Migration is one of the most popular WordPress migration plugins with over 2 millions active installations and 5,200+ 5 stars rating. The plugin is highly compatible with different operating systems and web hosting providers. It does not require any PHP extensions and works with all PHP versions from PHP 5.2 onwards. It supports WordPress version 3.3 to the latest version.

Requirement:

  • All-in-one WP Migration installed on both current a new WordPress site

How to use All-in-one WP Migration to Migrate A WordPress site

a. Current server

all in one wp migrate wordpress plugin
  1. On the current WordPress dashboard, click on “All-In-One WP Migration” > export
  2. (Optional) Use the Find Replace within the database to replace existing domain name, if you change the website domain name on the new server
  3. Click “EXPORT TO” and select FILE to download the website export file (.wpress file extension)

b. New server

all in one wp migrate import site
  1. On new cloud hosting WordPress dashboard, click on “All-In-One WP Migration” > import
  2. Click “IMPORT FROM” > FILE (or your .wpress export file source)
  3. Select your website export file (.wpress) to start website import
  4. Click the “Proceed” button to overwrite the WordPress site with your All-in-one WP migration export file.
  5. “Your site has been imported successfully!”

Note:

  • The free plugin has a 512MB upload limit for importing website
  • You can buy the Unlimited extension to remove the import limit, restore a backup from the server, and support WP-CLI commands. Other cloud storage extensions are available too.
  • You may need to save the WordPress permalink structure twice after import complete.

3. WordPress Migration with WP-CLI and Rsync

Using WP-CLI and Rsync is the fastest way to migrate a WordPress site. It is more stable and reliable than using a WordPress plugin. Recommended if you want to migrate a huge website and you have SSH access on both existing and new servers.

WP CLI is a powerful command line tool for managing WordPress. You can install WordPress. update plugins configure multisite, and much more, without using a web browser.

Rsync is a Linux command line tool for fast local and remote file synchronization. It is a popular tool and included in most Linux distribution by default. Digital Ocean has a good tutorial on using Rsync to sync directories on the server.

Requirement:

  • SSH access on both current and new servers
  • WP-CLI on both current and new servers

How To Install WP-CLI

You can easily install WP-CLI via shell with two command lines:

sudo wget -q https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/bin/wp
sudo chmod 755 /usr/bin/wp

How to use WP-CLI and Rsync to migrate WordPress site

a. Current server

  1. Connect to the current server via SSH
  2. Navigate to your WordPress root directory (example: /var/www/vhosts/sitename/public_html/)
  3. Export WordPress database using WP-CLI command:
    wp db export db.sql --allow-root

b. New server

  1. Connect to the new server via SSH
  2. Navigate to the directory where you want your WordPress site to be in (example: /home/runcloud/webapps/yoursite)
  3. Pull website files from a current server using Rsync:
rsync -avz --progress --exclude wp-config.php [email protected]:/var/www/vhosts/sitename/public_html/* .
  1. Create an empty WordPress database. RunCloud user can easily create a database via RunCloud dashboard. You can create a database using command lines too:
    mysql -u root -p
    You will enter MySQL shell then use the following commands to create WordPress user and database:
CREATE USER wordpressuser@localhost IDENTIFIED BY 'passw0rd';
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'passw0rd';
FLUSH PRIVILEGES;
quit;

Remember change passw0rd to the secure password, you want to use. These credentials will be used for the wp-config.php file.

  • Generate WordPress configuration file using WP-CLI command: wp core config --dbname=wordpress --dbuser=wordpressuser --dbpass=passw0rd --allow-root
  • Import the WordPress database dumped in the directory using WP-CLI command: wp db import db.sql --allow-root
  • Update WordPress installation ownership and use the recommended permissions for files & directories:
sudo chown -R runcloud:runcloud /home/runcloud/webapps/yoursite/
sudo find /home/runcloud/webapps/yoursite/ -type f -exec chmod 644 {} +
sudo find /home/runcloud/webapps/yoursite/ -type d -exec chmod 755 {} +

Note:

  • If the SSH is using a non-standard port, you can pass the port parameter to SSH with the -e option: rsync -avz -e 'ssh -p <port-number>' --progress --exclude wp-config.php [email protected]:/var/www/vhosts/sitename/public_html/* .
  • If you are migrating to a new domain. Run database search & replace to update the new domain name in the database: wp search-replace 'https://old-domain.com' 'https://new-domain.com'
  • runcloud:runcloud is a reference that is in place of your system username
  • /home/runcloud/webapps/yoursite where runcloud should be the system username and yoursite should be your web application
  • To fix ownership of system user, use the navigation menu and go into your web application, scroll down to Tools, and click the Fix Ownership button.

Tips: DNS Propagation

After website files and database migration, you will need to update the domain name’s DNS records to the new cloud server IP address.

You can try speeding up the DNS propagation time by lowering the TTL (Time To Live). This will refresh the DNS at a quicker rate. You can try set TTL to as low as 120 (2 minutes). However, some of the networks may still update slowly.

Wrapping Up

RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, backup your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!