# Doing VM Backup in AWS

<span style="white-space: pre-wrap;">Here is guide to automate backups of your </span>****finmars-platform-vm****, including both its EC2 settings (AMI) and its disk (EBS volumes), all in one place:

1. ****Sign in to AWS****
    - <span style="white-space: pre-wrap;">Open your browser and go to </span>[console.aws.amazon.com](https://console.aws.amazon.com).
    - Enter your AWS username and password.
2. ****Open AWS Backup****
    - <span style="white-space: pre-wrap;">In the top search box, type </span>****Backup****.
    - <span style="white-space: pre-wrap;">Click </span>****AWS Backup****<span style="white-space: pre-wrap;"> when it appears.</span>
3. ****Create a new backup plan****
    1. <span style="white-space: pre-wrap;">In the left menu, click </span>****Backup plans****.
    2. <span style="white-space: pre-wrap;">Click </span>****Create backup plan****.
    3. <span style="white-space: pre-wrap;">Choose </span>****Build a new plan****.
    4. <span style="white-space: pre-wrap;">Give the plan a name, for example </span>****finmars-daily****.
    5. <span style="white-space: pre-wrap;">Under </span>****Backup rule****, set:
        - ****Frequency****: Daily
        - ****Time****: 01:00
        - ****Retention****: e.g. keep for 7 days
    6. <span style="white-space: pre-wrap;">Click </span>****Create plan****.
4. ****Edit the rule to back up both EC2 and EBS****
    1. <span style="white-space: pre-wrap;">Under your new plan, find the </span>****Backup rule****<span style="white-space: pre-wrap;"> you just made.</span>
    2. <span style="white-space: pre-wrap;">Click the three-dot menu next to it and choose </span>****Edit rule****.
    3. <span style="white-space: pre-wrap;">Scroll to </span>****Resource selection****.
    4. <span style="white-space: pre-wrap;">For </span>****Resource type****<span style="white-space: pre-wrap;">, pick </span>****Amazon EC2****.
        - This makes AWS Backup create an AMI of your instance.
    5. <span style="white-space: pre-wrap;">Click </span>****Add another resource type****.
    6. <span style="white-space: pre-wrap;">Pick </span>****Amazon EBS****.
        - This makes AWS Backup snapshot your volumes.
    7. <span style="white-space: pre-wrap;">Click </span>****Update rule****.
5. ****Assign your VM and its volumes****
    1. <span style="white-space: pre-wrap;">In your plan, click </span>****Assign resources****.
    2. <span style="white-space: pre-wrap;">Give the assignment a name, like </span>****finmars-vm-and-volumes****.
    3. <span style="white-space: pre-wrap;">Under </span>****Select resource IDs****, choose:
        - <span style="white-space: pre-wrap;">Your </span>****finmars-platform-vm****<span style="white-space: pre-wrap;"> instance ID</span>
        - The IDs of its EBS volumes (usually listed under the instance)
    4. <span style="white-space: pre-wrap;">Click </span>****Assign backup****.
6. ****Check your automated backups****
    - <span style="white-space: pre-wrap;">In the left menu, click </span>****Backup vaults****<span style="white-space: pre-wrap;"> to see where backups are stored.</span>
    - <span style="white-space: pre-wrap;">Click </span>****Protected resources****<span style="white-space: pre-wrap;"> to confirm your VM and volumes are listed.</span>
7. ****Change or stop the plan****
    - <span style="white-space: pre-wrap;">To change schedule or retention, go to </span>****Backup plans****<span style="white-space: pre-wrap;">, select </span>****finmars-daily****, then edit the rule.
    - <span style="white-space: pre-wrap;">To stop backups, select the plan and click </span>****Delete****.

---

🎉 Now AWS Backup will run every day at 01:00. It will:

- ****Create an AMI****<span style="white-space: pre-wrap;"> of your EC2 instance (so you can launch a new server with all settings intact)</span>
- ****Snapshot your EBS volumes****<span style="white-space: pre-wrap;"> (so your data and files are safe)</span>