Knowledgebase

How to Migrate your WordPress Site to RCS with UpdraftPlus Print

  • 0

UpdraftPlus is a WordPress backup, clone, and restore plugin that makes it possible to migrate your website files safely from one server to another. It offers both free and premium versions with different features available on each. In this article, you will learn how to migrate your WordPress website to a RCS cloud server with the UpdraftPlus free version.

Replace example occurrences with your actual server username.

Prerequisites

Step 1: Create a new WordPress Database on the Server

Login to MySQL.

$ mysql

Create the database.

mysql> CREATE DATABASE wp;

Create a new database user with a strong password.

mysql> CREATE USER `admin`@`localhost` IDENTIFIED BY 'secure-password';

Grant the user full privileges to the database.

mysql> GRANT ALL PRIVILEGES on wp.* TO admin@localhost;

Refresh MySQL rights.

mysql> FLUSH PRIVILEGES;

Exit the MySQL console.

mysql> exit

Step 2: Setup FTP

Install VsFTPD.

# apt install vsftpd

Now, set up a new FTP user account (non-root) to use for file transfer.

# adduser example

Create an FTP files subdirectory in the user’s home directory.

# mkdir /home/example/FTP



    # chown example:example /home/example/FTP

Now, edit the VsFTPD configuration file located in the /etc directory.

# nano /etc/vsftpd.conf

Confirm that the following lines are uncommented (don’t have a hash #). Else, uncomment them.

# Uncomment this to enable any form of FTP write command.

write_enable=YES

Save and close the file.

Next, allow FTP connections through the uncomplicated firewall (ufw).

# ufw allow 21/tcp

Allow FTP data connections.

# ufw allow 20/tcp

Restart the firewall.

# ufw reload

Step 3: Backup your WordPress Site to the RCS Server

Login to your active WordPress website, and install the UpdraftPlus plugin.

https://example.com/wp-login.php

Open the Updraft Plugin through Settings > UpdraftPlus Backups. Then, navigate to the Settings tab, and select FTP from the Choose your remote storage: section.

UpdraftPlus FTP Setup

Under FTP, fill in the FTP Server, FTP login, FTP Password, Remote Path, with your RCS Server IP Address, user account, password, and the FTP files directory. Then, click Test FTP Settings to create a test connection, once successful, scroll down the page and save changes.

Next, navigate to the Backup/Restore tab, and click Backup Now. Select your preferred database and file backup options, then, click Backup now to start the file transfer process.

UpdraftPlus Backup Transfer

Step 4: Prepare the Server WordPress Files

Access your RCS server, and switch to the FTP files directory.

# cd /home/example/FTP

List files in the directory to confirm received files.

# ls -l 

Your Output should be similar to:

-rw------- 1 example example       0 Feb  8 11:44 6fcb151375bcc88043ec953c1074ce88.tmp

-rw------- 1 example example  333671 Feb  8 12:05 backup_2022-02-08-1205_Example_Website_c68901c14549-db.gz

-rw------- 1 example example     196 Feb  8 12:05 backup_2022-02-08-1205_Example_Website_c68901c14549-others.zip

-rw------- 1 example example 7315215 Feb  8 12:05 backup_2022-02-08-1205_Example_Website_c68901c14549-plugins.zip

-rw------- 1 example example 7650604 Feb  8 12:05 backup_2022-02-08-1205_Example_Website_c68901c14549-themes.zip

 -rw------- 1 example example     336 Feb  8 12:05 backup_2022-02-08-1205_Example_Website_c68901c14549-uploads.zip

Now, create a new directory wp-content, and use the command below to extract all .zip files to the directory.

# mkdir wp-content

# for z in *.zip; do unzip "$z" -d wp-content/; done

Next, use gunzip to extract the database archive .gz.

# gunzip filename-db.gz

Restore the database to your existing database created on Step 1.

# mysql -u admin -p wp < backup_2022-02-08-1205_Example_Website_c68901c14549-db

Your database file may be different, be sure to replace the above command with your file

In case you receive the error ERROR 1067 (42000) at line 250: Invalid default value for 'user_registered', simply edit the database file, and add the following lines at the beginning of the file.

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 

SET time_zone = "+00:00";

Once successful with database restoration, log in to MySQL, and verify that WordPress tables are added to the database.

# mysql -u root admin -p

Switch to the WordPress database.

mysql> use wp;

Show all tables.

mysql> show tables;

Your tables should be similar to:

+-----------------------+

| Tables_in_wp          |

+-----------------------+

| wp_commentmeta        |

| wp_comments           |

| wp_links              |

| wp_options            |

| wp_postmeta           |

| wp_posts              |

| wp_term_relationships |

| wp_term_taxonomy      |

| wp_termmeta           |

| wp_terms              |

| wp_usermeta           |

| wp_users              |

 +-----------------------+

Copy the WordPress table prefix (first characters before _) since you have to declare them in the wp-config.php file.

Step 5: Complete WordPress Migration

First, delete the wp-content directory, and wp-config.php files from your WordPress webroot directory.

# rm -r /var/www/html/wp-content



# rm /var/www/html/wp-config.php

Then, copy the extracted wp-content folder to the WordPress directory.

# cp -r /home/example/FTP/wp-content /var/www/html/

Also, create a new wp-config.php file using the wp-config-sample.php template file.

# cp /var/www/html/wp-config-sample.php  /var/www/html/wp-config.php

Edit the file.

# nano /var/www/html/wp-config.php

Find the following lines:

/** The name of the database for WordPress */

define( 'DB_NAME', 'wp' );



/** Database username */

define( 'DB_USER', 'admin' );



/** Database password */

define( 'DB_PASSWORD', 'secure-password' );



/**

 * WordPress database table prefix.

 */



$table_prefix = 'wp_';

Edit them to reflect database name, database user, database password, and table prefix respectively.

Save and close the file.

Grant the webserver full permissions to the WordPress directory.

# chown -R www-data:www-data /var/www/html

Now, visit your Server IP, log in, and confirm that your WordPress website is fully restored.

http://RCS-Server-IP/wp-admin

Next, point your domain to RCS by editing your name servers, and set up new DNS A records in the customer portal. As well, edit your web server (Apache or Nginx) configuration to include your domain name in the WordPress configuration file.

Additionally, request a free Let’s Encrypt SSL Certificate once your DNS records are pointed to the RCS server. Your domain should be able to serve and use web files from your new RCS server between 15 minutes to 1 hour, though full propagation may take between 12-24hours to complete.

Conclusion

Congratulations, you have successfully migrated your WordPress site to RCS using UpdraftPlus. If you are migrating from a shared hosting provider, you can safely delete your website once propagation is complete, and confirm that WordPress files are present on the server.


Was this answer helpful?
Back

Powered by WHMCompleteSolution