How to Migrate WooCommerce to Alibaba Cloud ECS with Let’s Encrypt

This article was originally published on OKTA Blog. Thank you for supporting the partners who make SitePoint possible.

Alibaba Cloud is a provider that is gaining significant visibility as of late. One of the main products it offers is ECS (Elastic Compute Service) or, to put it into simpler terms, a flexible, cloud-based VPS. Those acquainted with the market of cloud computing products will notice similarities with Amazon’s Elastic Cloud – and they’d be right. Upon testing the Alibaba Cloud’s ECS, we can say it is a strong competitor to Amazon, and other vendors in the cloud computing space.

In fact, if we judge by the diversity of products Alibaba Cloud has in its offering, we could perhaps say they are already there.

For this article, we took the practical task of moving a fully-fledged, production eCommerce website to an Alibaba ECS instance (we used an actual live website running on another domain, and moved it to a test domain).

The installation we used was a WooCommerce website with hundreds of products, users, and significant disk space usage.

Elastic Compute Service

Once we register with Alibaba Cloud, we are offered US$300 worth of credit to try out its products (once we confirm our payment methods, such as a credit card, or PayPal account). These funds can go toward deploying and testing an ECS instance.

After logging in, we navigate to our management console, select Elastic Compute Service in the menu on the left, and then Instances. Once we click this link, we are presented with a button on the right to Create Instance.

We are then presented with options we can choose for the instance – Billing Method, Region – meaning the location of our server – and Instance Type. We can select from several architectures (we went with x86 Architecture) and categories such as General Purpose, Compute Optimized, Memory Optimized, High Clock Speed and other types.

We can then select one of the offered server sizes – by memory size, virtual core count, clock speed, and so on.

Below this, we can select one of the offered images – there are a number of operating systems we can choose, including Alibaba’s own Aliyun Linux, CentOS, Ubuntu, Windows Server, and others. Among Marketplace Images, there is a large selection of preconfigured application images we can select.

Here we are selecting the Plesk free image, since it offers us a number of convenient ways to manage our server – domain management, database management, and WordPress application management – all in one web interface.

If we have a Plesk license obtained separately, or we want to pay more, we can get premium version of Plesk with even more features that make professional server management a lot simpler.

Another convenience of Plesk instances is that they have been hardened and secured with configured firewall rules. It also comes with phpMyAdmin preinstalled. This is great because, considering that we are using a LEMP server stack, installing and configuring phpMyAdmin can take some work.

We then select storage – SSD disk is the recommended option, with up to 500GB in size.

We can then select networking options – here we will probably be okay if we go with the default preselected options. We can also configure security groups – a useful thing if we have more than one server instance.

Now we come to SSH access configuration. Here we can configure our SSH keys for passwordless access, which is generally recommended. However, since we are doing a migration, we will configure password access, so we don’t have to copy public SSH keys from the server we are migrating from.

We should take a note of the password we created here. If we forget the password, we can reset it in the ECS console.

After we complete our order, we can go back to the web console and wait for a minute or two till our instance is created. Once the instance is running, we can connect to the system shell through a VNC session in our browser. Once we do this, our instance spits out further instructions in the shell:

We need to create a security rule which will open the ports we need, and enable us to access our instance. Once we have done this, we can connect to our instance via SSH shell (or continue our VNC session), and generate our Plesk admin account:

We will copy the second URL which will allow us web access to the Plesk admin.

Once we visit this URL in our browser, we will create our account:

We presume here that we have a domain, and we have pointed our domain – or subdomain – to our instance’s public IP address. If not, we are shown our IP once we are logged into Plesk admin console. Once we have pointed our domain to this IP, we can create a Webspace – basically a virtual host for our website. We would otherwise need to manually configure nginx for this, but with Plesk, we have the convenience of doing this the easy way.

We can also secure the domain with a Let’s Encrypt certificate. Again, we would otherwise do this manually, installing certbot and creating a certificate for our virtual host / website. Here, it is just a checkbox we need to check.

The Convenience and Simplicity of Plesk

In this guide we needed to preserve the integrity of our existing WordPress and WooCommerce installation, and to avoid conflicts, we cloned an entire WordPress directory to our created website / domain root. But for the purposes of new installations, Plesk offers one click deployment of WordPress – along with dozens of other applications, such as OpenCart, Magento, Prestashop, Drupal, Typo3 and others.

The convenience of using the Plesk interface is that we will be able to manage our entire stack from a unified web interface, from managing our server configuration, editing our php.ini file, to installing and updating our WordPress and plugins.

If we migrated our website through SSH / rsync like we did, we will need to click the scan button for Plesk to detect our website.

From the Plesk interface, we can also turn on nginx caching, and back up and restore our website. There are more options available for paying users of Plesk (we can easily upgrade our license), and it will make website management a lot easier.

But to reach this stage, we will first clone our website to the new instance.

The post How to Migrate WooCommerce to Alibaba Cloud ECS with Let’s Encrypt appeared first on SitePoint.

Powered by WPeMatico