How To

How to migrate existing WordPress Site to EasyEngine v4

WordPress migration to the cloud

WordPress requires no introduction and same is the case with EasyEngine, a tool which makes life easy of WordPress hosted servers as well as system admins or DevOps guys. This open source tool is now all set to adopt docker containers for its 4th version.

Although this is a welcome move from rtCamp, the company behind this tool, but unfortunately not all developers and system admins are familiar with containers. However, moving to docker is the need of an hour and thanks to rtcamp guys who adopted it for their 4th version of EasyEngine.

Migrating your WordPress install might be a headache especially if you are not a developer or run a high traffic site. EE is currently used by many high traffic WordPress sites globally.In addition to this headache playing with containers is not everyone’s cup of tea. Lets find out how you can migrate your existing WordPress install to EE v4 without much efforts.

Step 1: Backup you existing WP files and its respective Database

All you need is a wp-content directory as a backup and your DB backup. There is absolutely no need to copy all files and folders simply because all of your plugins, themes and images are stored in wp-content directory.

Simply take a backup of wp-content directory and your DB file in sql format in a tar.gz file. Place this file in your html directory or a directory which is exposed to port 80.

Note: if you have played with wp-content or wp architecture for custom development, you need to make the necessary changes and migrated those files / folders accordingly.

Step 2: Install EE v4 on a brand new server

In order to install EE v4, you need a new server which does not have any other tools or scripts preinstalled. We use and recommend Ubuntu 18.04 LTS server from E2E Networks or Digital Ocean.

Login into your new server and copy paste the following command as below:

wget -qO ee rt.cx/ee4beta && sudo bash ee

This will automatically download EE v4 scripts, Docker etc and also install them.
Now, create site with your existing site name using

ee site create domain.com --wpredis

The above command will create site with your domain and install WP as well as setup Redis for you. Just save the site info in Notepad which includes WordPress credentials as well as DB credentials.

Update: EasyEngine version 4 now supports Letsencrypt. To create SSL  sites use

ee site create example.com [--letsencrypt|--le] 

Login into PhpMyAdmin using DB credentials from your browser through the following url

http://domain.com/ee-admin/pma/ and select all tables from the DB and drop them.

Step 3: Migrate your existing WP

After you drop all the tables from DB either import your existing db backup from phpmyadmin if the size of your .sql file is in few MBs. Else, import it using

cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root –password=root DATABASE through CLI.

All of your WP Files and Folders are located here /root/ee-sites/domain.com/app/src
Now, change directory using cd /root/ee-sites/domain.com/app/src and delete existing wp-content using rm -rf wp-content

Download your existing backup in the same directory using wget http:// or https://domain.com/file.tar.gz

Extract the file using tar -zxvf file.tar.gz command. Now, change ownership and permission of  wp-content directory by using

 chown -R www-data:www-data wp-content

Lastly, edit your wp-config.php file and ensure that you replace table prefix with your current table prefix used in your DB and save the necessary changes.

Change  NameServers or A record IP to the new one. Login into your wp dashboard and just save permalinks once.

Its Done. Your site is now live on your new server.

Notes:

  1. EE v4 is currently in beta stage and should not be used in production
  2. Whenever you update EE or reboot your server, all of your containers are stopped and you need to restart all the containers by using
docker restart $(docker ps -a -q)

We will keep you updated as and when EE releases new updates for v4.

If you have any queries or stuck somewhere while migrating to new server using EE v4, do not hesitate to ask for help on VD Forum

Author Details
Vineet Suratran is Founder and Editor-In-Chief at venturedawn.com. He is an Electronics & Telecommunications Engineer by profession and blogger by passion.
×
Vineet Suratran is Founder and Editor-In-Chief at venturedawn.com. He is an Electronics & Telecommunications Engineer by profession and blogger by passion.
Latest Posts
  • WordPress migration to the cloud
  • Bank Lockers
  • Indian Telecom Operators

Comment here