This tutorial describes how to use StackMover Lite wordpress plugin to clone a live wordpress onto a new Amazon LightSail instance. In order to use the plugin, you would need to be able to create an IAM user with privileges to read/write to an Amazon S3 bucket and launch Amazon LightSail instances.
Step 1: Create IAM User
Stackmover uses an IAM user to securely control access to specific S3 bucket and create LightSail instances. The process to create this user has been automated for ease of use via AWS CloudFormation. To create the IAM user, simply launch AWS CloudFormation template as below.
The CloudFormation template could be used to either create a new S3 bucket or use an exiting bucket. An IAM user is created inside the template with minimal set of specific privileges needed during migration. The specific set of privileges assigned to the IAM user is as below.
In the example below, an existing S3 bucket stackmover-demo is being used.
Once CloudFormation stack is complete successfully, secure the AWS Access Key and Secret Key securely (found in Output tab).
Step 2: Verify IAM Keys
In the StackMover plugin page, enter the AWS Access Key and Secret Key and verify the validity of the keys. Validation process ensures S3 bucket is accessible via plugin.
Step 3: Add Migrator Options
Modify default transfer option as needed. Plugin will transfer all themes, plugins and database dump created via mysqldump onto a new LightSail instance. A search and replace operation in the database is also available as an option.
The database string replacer works on the destination database only and hence the source database remains unchanged. Currently, if you specify EIP in the replace-with string, it will be replaced with the Elastic IP of the LightSail instance. For example, when a dev system running wordpress on http://localhost:8888/wordpress is migrated to a LightSail instance, you may choose the replacer to be http://EIP and the new elastic IP will be used by replacer in the place of EIP.
Step 4: Single Click Migration!
With all the option in place, we are ready to migrate a live instance onto a new LightSail. This process will create a compressed file bundle in the chosen S3 bucket with all the necessary files needed to clone the source wordpress. A new LightSail instance running ubuntu OS is launched and a LEMP stack (Linux + Nginx + Php + Mysql) is setup at run time. Files are moved from the destination S3 bucket onto the LightSail instance and database imported. The resulting public IP should be running the cloned wordpress.