EasyEngine is a good open source tool by rtcamp for wordpress sites which receives high traffic. Nginx and Maria DB configurations with caching at server level is something which is not that easy. EasyEngine tunes and installs mysql ,nginx, nginx fastcgi cache, X-cache, Opcache etc which helps improve your wordpress site’s overall performance to a greater extent. Nginx web server most of the times crashes with high traffic sites and tools like EasyEngine makes sure that your web server and DB server are fine tuned. Thus, helps prevent crashing of servers and also improves performance with the help of right tools, stack and packages it installs.This is the only open source tool which has so far lived up to the expectations of the wordpress site owners and server administrators.
Now, most of us have existing wordpress sites hosted on Cpanel servers, shared hosting, managed hosting or any other web server for that matter. Hence, migrating your existing site to the new server with EasyEngine setup is necessary in order to run your site with this awesome tool. Though you may come across some tutorials and docs on EasyEngine’s official website, many people find it difficult or complain about incomplete information to migrate their existing site successfully to their new server with EasyEngine setup without causing any downtime and ensuring hassle free migration.
Here is a Step-by-Step guide which will help newbies to migrate their existing wordpress site into EasyEngine:
1) Take backup of your database and wp-content folder (In most of the cases this is sufficient unless you have external files outside wp-content folder )
a) If you are currently on a Cpanel server, just create a tar.gz file having wp-content folder in the public_html folder for that particular site which you want to migrate.
b) Take backup of your database i.e export sql file via phpmyadmin if the size of your sql file is less. say some few Mega Bytes.
c) If you run a large website with DB size in hundreds of MBs or GBs, It is always advisable to take mysql dump via Command Line Interface(CLI). You can use the command as given below to take mysql backup:
mysqldump -u MYSQL_USER -pMYSQL_PASS DATABASE_NAME > DATABASE_NAME.sql
Note: It would be better to store this file in public_html/html etc in order to include in tar.gz backup file.
2) It is recommended to use Linode over Digital Ocean as it gives more resources as compared in same price. You may also use AWS, GCE or any other IaaS provider of your choice. Choose right server as per your site’s requirements and install EasyEngine as per instructions given below:
a) Ensure you use a raw new server without any packages or stack installed. I would highly recommend to use Ubuntu 16.04 LTS as it is the latest stable OS from Ubuntu. Use the following command in the root directory to install EasyEngine:
wget -qO ee rt.cx/ee && sudo bash ee
b) Follow on screen instructions and wait till EasyEngine gets installed successfully. After installing EE, Install its stack by using the command as below:
ee stack install
c) Now, install all Admin tools like phpmyadmin and note down HTTP Authentication password for phpmyadmin directory. By default its username is easyengine. Use following command for installing admin tools:
ee stack install --admin
d) Install php7 by using the command as given below:
ee stack install --php7
3) Create site by using the command as given below:
ee site create example.com --wpfc --php7
Replace example.com with your own domain
Note: I am using Nginx FastCGI cache and hence using wpfc. You may install wordpress without cache or using another cache of your choice
4) Now go to htdocs directory by changing directory from the root directory using the command as shown below:
Replace example.com with your own domain
5) Delete wp-content directory by using the command as shown below.
6) Download backup file using wget command in htdocs directory.
7) Use the command as below to extract files from respective tar.gz file.
tar -zxvf backupfilename.tar.gz
8) Using phpmyadmin, drop all existing tables in the database. You may also use CLI to drop all the tables from the database.
9) Download wp-config.php file and replace the table prefix with your existing table prefix of your current site. Also add this line in the file as shown below:
Save the file and upload via sftp client in var/www/example.com. Overwrite the existing wp-config.php file.
10) Now, either import sql file from your local computer which you had exported from your old server’s phpmyadmin or import via CLI by using the command as given below:
mysql -u MYSQL_USER -pMYSQL_PASS DATABASE_NAME < DATABASE_NAME.sql
Remember to replace proper credentials and proper path. Perform this operation from root directory.
11) Now go to htdocs directory and ensure that wp-content folder have same permission as the . line or the first line, which is www-data for user and www-data for group. You will see it is not, so, enter the following command to fix:
chown -R www-data:www-data wp-content
12) Install nginx helper plugin from wp dashboard and enable page caching and rightly select purge cache settings.
13) Replace your existing ip address in the A record with the new ip address of your new server.
That’s it. Now your site should be up and running on your new server with EasyEngine setup.
Do let me know your experience of migrating to EE setup via comments here. Also, let me know if you know any other fastest and easiest method to migrate than this one.