cloud lifegurard
CPM Cloud Protection Manager
Enterprise-class EC2 Backup
and Disaster Recovery
 
TRY CPM FREE FOR 30 DAYS
Type your first name

Type your last name

Please let us know your email address

Please type your company name

Please type your phone number

By submitting this form you agree to the Terms of use

Backup Your High-Availability Wordpress Website with CPM using AWS Tags

Written by  N2W Software Team Friday, 14 April 2017

how-to-backup-high-availability-wordpress-website-AWS-tagsIn the first article we learned about AWS Tags and best practices associated with this. For an organization working in the cloud with a number of servers the backup strategy is very important for them. If the resources are in the AWS cloud, you must take advantage of Auto Scaling and Elastic Load balancing to achieve scalability along with cost optimization. In this case automation will play a key role for the backup since AutoScaling may launch new EC2 resources as well terminate resources based on defined conditions.

In this second article we will talk about how do we use CPM to achieve automated backup using the AWS tags. We will take a use case where we will setup a Wordpress Site on two separate EC2 instances and load balance them using ELB. The MySQL database will also be hosted on separate EC2 instance.

When you are setting up production Wordpress site, it is very important that you use AutoScaling with ELB. All Wordpress servers should connect with the single database (RDS or MySQL hosted on EC2) source. Do remember to launch web server EC2 instances in separate zones to achieve HA. If you are using AutoScaling, it would manage this functionality automatically as well register new launched instance with ELB.

Cloud Protection Manager (CPM)

CPM is an enterprise backup, recovery and disaster recovery solution for EC2. It allows you to automate and maintain backups of your entire EC2 environment as well as achieve application-consistent backups. This is done by providing a mechanism to perform certain tasks before and after snapshots are taken, informing your OS of the backup.

CPM does help to achieve regular, application consistent backups using the scheduler and policy as defined in backup solutions. In addition to this CPM offers automated backup scheduling using AWS tags. CPM does have capability to scan the AWS resources (EC2, RDS) automatically and schedule them for backup. To enable this, you must have added tag with key as “cpm backup” and value as your cpm backup policy name. If a policy with the defined name does not exist, CPM will create the policy.

For this article, we have setup a Wordpress site and launched two instances for this. We have configured ELB & AutoScaling on AWS as production website. We are using AWS Application based load balancer.

ha-wordpress-01 

We have configured a blog on the Wordpress site and want to plan backup of both Wordpress as well DB. The Wordpress is accessed through ELB.

 ha-wordpress-02

We want to automate the backup of EC2 instances on which Wordpress site is hosted as well MySQL database hosted on separate EC2 machines. To automate the tag based backup with CPM, it is required that each resource (EC2, RDS) should have the tag with key as “cpm backup” and value as the name of the policy.

Tags for the Wordpress EC2 Instance are shown below.

 ha-wordpress-03

Tags for the MySQL EC2 Instance is as below.

 ha-wordpress-04

It is important to note that wordpress_cpm_backup is name of backup policy defined in CPM.

 ha-wordpress-05

If above policy is not defined CPM will create new policy with the same name. To achieve this as well to scan resource for automated backup, you should enable Scanning in General settings of CPM.

 ha-wordpress-06

When this setting is enabled, it will automatically scan resources from AWS account, find all the resources with tag “cpm backup” and schedule them for backup with CPM policy defined above.

 ha-wordpress-07

You can verify the resources scheduled for backup from policy. It shows both EC2 Wordpress Instances as well MySQL DB.

 ha-wordpress-08

CPM will schedule the backup and create the snapshots automatically based on schedule configured with policy.

 ha-wordpress-09

We can verify the backup snapshots from backup monitor.

 ha-wordpress-10

Final Note

In this article, we showed how CPM can help you achieve tag based automated backup of your web application. It is also important to note that when you setup AutoScaling with your Wordpress instance, you should configure it such a way that it should also have tags with key “cpm backup” and key as policy name. This will ensure that any new instance that was spun up by Auto Scaling will be automatically scheduled for backup.
Generally users plan backup of database for recovery but it is also important that you configure backup of your web server instance because it may have some log or configure data which might be useful for future recovery. CPM will help.

CPM, is an enterprise-class backup, recovery, and disaster recovery solution for EC2. It uses existing EBS volume and RDS database snapshot abilities to automatically take snapshots at regular intervals. Additionally, you can set up policies and schedule backups for various targets. CPM helps manage snapshots with policies. For example, if you have multiple snapshots, the older ones may be irrelevant. With CPM, you can configure a policy to delete the snapshots after a certain period. This also helps in cost savings and effective backup management. Learn more about CPM

Start Protecting Your Cloud Deployment Properly

Start your free trial today to ensure implementing an automated robust, scalable, enterprise-class cloud backup and recovery solution