{"id":285721,"date":"2021-06-28T14:36:07","date_gmt":"2021-06-28T11:36:07","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots-cloudsavvy-it\/"},"modified":"2021-06-28T14:36:07","modified_gmt":"2021-06-28T11:36:07","slug":"how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots-cloudsavvy-it\/","title":{"rendered":"#How To Backup Your AWS EC2 Instances To S3 With EBS Snapshots \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3dfe0abc75e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3dfe0abc75e\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots-cloudsavvy-it\/#Why_Backup_a_Server_Already_In_The_Cloud\" >Why Backup a Server Already In The Cloud?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots-cloudsavvy-it\/#Configuring_EBS_Snapshots\" >Configuring EBS Snapshots<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots-cloudsavvy-it\/#Relaunching_a_Server_From_An_EBS_Snapshot\" >Relaunching a Server From An EBS Snapshot<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How To Backup Your AWS EC2 Instances To S3 With EBS Snapshots \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-5269\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"AWS Logo\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>It\u2019s easy to think that servers in the cloud are a magical service that just works. In reality, they\u2019re just someone else\u2019s computer, and all computers break down at some point. If you\u2019re using EBS-backed EC2 instances, you should perform regular backups to AWS S3.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Why_Backup_a_Server_Already_In_The_Cloud\"><\/span>Why Backup a Server Already In The Cloud?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Even cloud servers aren\u2019t safe from failure. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/ebs\/?ebs-whats-new.sort-by=item.additionalFields.postDateTime&amp;ebs-whats-new.sort-order=desc&amp;tag=reviewgeek-20\">EBS volumes<\/a>, which all AWS EC2 instances run on, are not entirely redundant. This means that if your server experiences a drive failure, you could lose your data.<\/p>\n<p>There\u2019s no need to panic though, as EBS volumes are actually\u00a0<em>fairly<\/em> safe, all things considered. They do use RAID and as such are redundant, and are about 20 times safer than normal disk drives.<\/p>\n<p>However, they can and do still break down from time to time, so you should prepare for this case, and keep backups. EBS has a failure rate of 0.1% \u2014 0.4% annually, compared to a normal disk\u2019s rate of around 4%. If you\u2019re running a lot of them, you\u2019re more likely to encounter a failure.<\/p>\n<p>EBS <code>io2<\/code>\u00a0volumes are the most durable, but all other types have only 99.8% \u2013 99.9% durability, which pales in comparison to S3\u2019s\u00a099.999999999% durability (which is basically as good as it gets before it loses all its meaning). S3 objects are backed up across multiple datacenters. EBS is stored in a single Availability Zone.<\/p>\n<p>Even AWS has had massive datacenter problems. In 2019, they had a power failure that killed the EBS servers at one of their facilities. Because they only host EBS locally in the same Availability Zone as the EC2 instance, this one failure completely destroyed all customer data stored on those volumes.<\/p>\n<p>Luckily, this is fixed very easily, as AWS provides an easy-to-configure service for automating backups to S3, which is as safe as it gets.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Configuring_EBS_Snapshots\"><\/span>Configuring EBS Snapshots<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You may be worried about backing up a large drive, but EBS snapshots are incremental backups. This means that for every consecutive snapshot, only the data that has changed is added to the backup file.<\/p>\n<p>Doing regular backups won\u2019t fill up your S3 bucket, though, for use cases where the drive is constantly being written to, your backup files may be quite a bit larger than the drive itself. Luckily, S3 storage is very cheap in comparison to EBS, and snapshot data can be expired over time.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-5595 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/07\/bd4799fe.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"EBS snapshots.\" width=\"700\" height=\"614\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Turning EBS snapshots on is fairly simple. Head over to the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/console.aws.amazon.com\/ec2\/v2\/?tag=reviewgeek-20\">EC2 Management Console<\/a>, and click on \u201cLifecycle Manager\u201d under Elastic Block Store. Create a new lifecycle policy.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-5596 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/07\/e2aad27c.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Elastic Block Store &gt; Lifecycle Manager to create a new policy.\" width=\"402\" height=\"146\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Then, you\u2019ll need to specify a tag for this policy to <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ly to. It can either select EC2 instances or EBS volumes directly when looking at tags.<\/p>\n<p>If you want it to apply to all your servers, you\u2019ll need to make a new tag, set it here, and apply it to all your volumes. If you just want to turn it on for one volume, select \u201cName\u201d and find the name of the volume.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-5597 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/07\/53f9337c.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Specify tag for policy to apply to.\" width=\"700\" height=\"259\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Then, you\u2019ll need to set the schedule. For quickly changing data, backing up often can incur more costs. The default is every 12 hours daily, which is probably fine for most people, but for servers that aren\u2019t experiencing write-heavy loads, backing up more often won\u2019t hurt.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-5598 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/07\/c9b938f9.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Set schedule for policy and policy for snapshot retention.\" width=\"700\" height=\"323\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The other thing you\u2019ll need to configure is snapshot retention. This will delete older data after a certain number of days or backups. You\u2019ll want to set this high enough so that you won\u2019t experience data loss after a server failure if you don\u2019t restore quickly enough. Deleting data older than a few days to a week is fine.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Relaunching_a_Server_From_An_EBS_Snapshot\"><\/span>Relaunching a Server From An EBS Snapshot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Restoring is incredibly simple. You\u2019ll find the list of snapshots under EBS in the sidebar. Right-click on any one of them, and hit \u201cCreate Volume.\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-12208 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/06\/984b2876.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"create snapshot\" width=\"650\" height=\"290\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>A new EBS volume will be created with the snapshot data. You\u2019ll then need to mount it to your EC2 instance by turning the server off, detaching the broken volume, attaching the new one from the console, and rebooting the instance.<\/p>\n<p>If you\u2019re using a non-root volume, you can mount without any downtime, you\u2019ll just need to manually mount the drive in the OS with\u00a0<code>umount<\/code>\u00a0on Linux or\u00a0Disk Management on Windows.<\/p>\n<p>Restoring can take a little while though. AWS has an extra feature, called Fast Snapshot Restore, which keeps redundancy on hand that makes this process nearly instant. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/ebs\/pricing\/?tag=reviewgeek-20\">It costs money though<\/a>, and we don\u2019t really recommend using it for most workloads. EBS failures are rare enough that it\u2019s likely not going to be a problem, and even with Fast Snapshot Restore, you\u2019re still going to have downtime.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/12206\/how-to-backup-your-aws-ec2-instances-to-s3-with-ebs-snapshots\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How To Backup Your AWS EC2 Instances To S3 With EBS Snapshots \u2013 CloudSavvy IT&#8221; It\u2019s easy to think that servers in the cloud are a magical service that just works. In reality, they\u2019re just someone else\u2019s computer, and all computers break down at some point. If you\u2019re using EBS-backed EC2 instances, you should perform&#8230;<\/p>\n","protected":false},"author":1,"featured_media":285722,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-285721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/285721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=285721"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/285721\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/285722"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=285721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=285721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=285721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}