Instructions to transfer website from Shared Host to EasyEngine installation server

Tutorials 0 lượt xem
This is part 6 of 7 in the full EasyEngine series

This is the 6th article in EasyEngine Series

Today’s article I will guide you step by step to move a website from Shared Host service to EasyEngine installation server. 

Prepare 

  • A brand new Linux server with Ubuntu and EasyEngine installed. If you haven’t chosen a VPS yet, I encourage you to choose DigitalOcean or A2Hosting . 
  • Connect to the server as root using an SSH Client like MobaXTerm. 

Step-by-step instructions for transferring websites from shared hosts to Linux servers with EasyEngine

Step 1: Install the website on the Linux server

First you add the website domain you want to transfer with the following command of EasyEngine: 

ee site create domain.com --wpredis

For example: 

move website to server install easy engine 1

Then you access the folder containing the source code of the website you just created with EasyEngine with the following 2 commands: 

ee site cd domain.com
cd htdocs

Step 2: Delete the data of the newly created website

EasyEngine’s website creation command in the above step will create the database and WordPress source code for the website. Your task is to delete them all so that you can get the website’s data from the shared host later.

Delete the database with the following command (using WP CLI): ​

wp db reset --allow-root

Delete the source code with the following command (make sure you have moved into the website’s htdocs directory): 

rm -rf *

Step 3: Bring website data from shared host to Linux server:

You access the File Manager in the Shared Host’s cPanel. Compress the entire website source code. ​

Select the GZipped Tar Archive compression option. Enter the file name so that it is easy to remember. Click the Compress File(s) button to start the compression. ​

move website to server install easy engine 2

On the Linux server side, you get this archive with the following command: (replace domain.com with your website’s domain name, source_code.tar.gz with the name of the archive you created above. 

wget domain.com/source_code.tar.gz

For example: 

move website to server install easy engine 4

After downloading the compressed file to the Linux server, extract it with the following command: 

tar -xvf source_code.tar.gz

Because EasyEngine uses the wp-config.php file located in the /var/www/domain.com directory , not the file located in /var/www/domain.com/htdocs

So you need to rename the wp-config.php file of the old website you just transferred to the Linux server to anything. For example, you run the following command: ​

mv wp-config.php wp-config.old.php

Now you continue to transfer the database to the Linux server. 

First you go to phpMyAdmin on the old shared host and export the database to the sql file. ​

move website to server install easy engine 6

Now you upload this file to /var/www/domain.com/htdocs using sftp in MobaXTerm: 

move website to server install easy engine 7

Next, you import the old website data into the database of the new website on Linux with the following command (using the WP CLI): 

wp db import data.sql --allow-root

Data.sql is the file you just exported on the old website. Change the filename to suit your situation. 

Step 4: Check the file wp-config.php

​Using the Moba Editor available in MobaXTerm, you open the wp-config.php file located in  /var/www/domain.com/ . If your old website uses a different prefix table than wp_, you should correct it. If you do not edit any further, access the website and it will appear on the WordPress installation screen. 

move website to server install easy engine 11

Step 5: Re-authorize the folder

You need permission to avoid being asked for FTP information when updating or installing plugins in WordPress.

Run the following command to make sure the directory and files of the newly converted website are owned by user www-data and group www-data. ​

chown -R www-data:www-data /var/www/domain.com

Step 6: Install the necessary plugins

You need to run the command ee update site so that your website has just switched to receive automatic plugin installation and correct configuration with EasyEngine.

Initially, I created a website with the –wpredis option , now I will switch to –wpfc and then switch back to –wpredis . Having to do that, EasyEngine will automatically install the plugin and set the plugin to the –wpredis configuration in my case. ​

ee site update domain.com --wpfc

Step 7: Point the domain to the Linux server

The last step is to point your domain to the Linux hosting you just moved to. Then visit the website and test again to see if there are still errors or not.

It’s done.

You have just moved a website from a shared host to a Linux server with EasyEngine installed.

If you encounter any errors during the website transfer, please share in the comments below. ​

View articles in the series

Previous part: Instructions to install Let’s Encrypt certificate with EasyEngine Next part: Instructions to install Rclone to backup VPS to Google Drive

Bài viết liên quan