AWS Storage Blog

Recover Amazon EFS files and folders with AWS Backup

A large majority of data is unstructured files, and a large percentage of applications are designed around file storage. Most of these applications have an architectural requirement to use a shared file system. A self-managed shared file system solution requires a lot of heavy lifting. This includes getting and provisioning compute and storage resources, networking, load balancing, accurately estimating demand, managing the software, and managing replication for availability and durability. A fully managed shared file system removes the undifferentiated heavy lifting required with self-managed shared file systems, enabling organizations to focus on differentiating innovations and solutions. Amazon Elastic File System (Amazon EFS) provides a fully managed, cloud-native, highly reliable NFS-based shared file system at an effective storage cost of $0.08/GB-month.

While Amazon EFS provides a highly available and durable storage for your files, for added protection, it is recommended to create backups of your file system. If files are inadvertently deleted due to a human or application error, or if prior versions of files are needed, this comes in handy. AWS Backup is natively integrated with Amazon EFS. The service can be used to create backups of Amazon EFS file systems and to restore the entire file system, or recover files and folders from the file system. Recovering files and folders can be a good alternative to restoring the entire file system because it is faster and efficient. A fast recovery time objective (RTO) is essential when you must recover critical files. Restoring an entire file system and then extracting the critical files from it makes it difficult to meet your stringent RTO requirements. In this post, we walk you through recovering files and folders from a backup of an Amazon EFS file system that is backed up with AWS Backup.

AWS Backup for Amazon EFS

To backup an EFS file system using AWS Backup, you can set a backup plan where you specify your backup frequency, backup window, retention, and a lifecycle policy for your backups. You can then assign your EFS file system to the backup plan. A recovery point ID is created for every successful backup run and these help us in recovering EFS file systems and its files to a point in time. The details of using AWS Backup for backing up EFS file systems is documented here.

In this example scenario, the EFS file system (fs-7e70f9b5) has been backed up using AWS Backup as shown in the following screenshot:

In this example scenario, the EFS file system (fs-7e70f9b5) has been backed up using AWS Backup as shown in the following screenshot

After a successful backup, AWS Backup creates a recovery point and assigns a Recovery point ID as shown in the following screenshot:

After a successful backup, AWS Backup creates a recovery point and assigns a recovery point ID as shown in the following screenshot

To restore an EFS file system from a recovery point created using AWS Backup, you can perform a complete restore. With a complete restore, AWS Backup restores the file system in its entirety including all root level folders and files. However, often times there is a need to restore files or folders that have been inadvertently deleted due to a human or application error. Restoring an entire file system to recover a few files and folders makes it difficult to meet your stringent RTO requirements.

The solution: File and folder recovery

AWS Backup now supports recovering file and folders from an EFS file system backup created by the service. For a fast restore experience, you can perform an item-level restore and provide the path of the file or folder that is relative to the root of the file system (not including the mount point). This helps you recover your files and folders and meet stringent recovery time objectives. You can select and recover up to five items at a time. As with the full restore, with item-level restore, you can restore to a new file system or to a directory in the source file system.

In this example scenario, to recover a single file and a directory from an EFS backup, we have chosen the recovery point ID from the backup vault and selected Restore. In the following screenshot, depicting the Restore backup window shown, we have two options. We can choose to restore the full file system or restore individual items. After selecting Item-level restore, we input the path relative to the root of the file system (not including the mount point) for the file (fileA.txt) and directory (dirA) we want to restore. We also choose if we want to restore the items in the existing file system or in a new file system. Finally, we select Restore backup to start the restore job.

Finally, we select Restore backup to start the restore job

Cleaning up

In an effort to avoid incurring unwanted charges, you may want to clean up this solution by deleting example resources created while following along with this blog post. To clean up this solution, complete the following steps:

  1. If you created any test EFS file systems, delete them using the EFS console by selecting the file systems that you want to delete and choosing the Delete File System action. More details on deleting an EFS file system are documented here.
  2. If you created any test AWS Backup resources like Backup Plan, Recovery Points, or Backup Vault, you can delete them using the AWS Backup console. More details on deleting AWS Backup resources are documented here.

Conclusion

In this post, we demonstrated how AWS Backup provides added data protection for your Amazon EFS file systems by providing fully managed, centralized backup services to manage backups of your file systems. AWS Backup can be used to restore entire Amazon EFS file systems from an earlier point in time. Restoring entire file systems is a common use case when you want to recreate production workloads in test and development environments. The service can also be used to recover individual files and folders that have been accidently deleted due to a human or application error. Item-level restore gives you the flexibility in selecting and recovering individual files and folders you need from the backup and helps you in meeting your stringent RTO requirements.

Thanks for taking the time to read this blog post. You can learn more about Amazon EFS and AWS Backup here in this documentation. If you have any questions or comments, please leave them in the comments section

Abrar Hussain

Abrar Hussain

Abrar Hussain is a Principal Product Manager on the Amazon Elastic File System team, focusing on helping customers use EFS with their EC2 instances and protect EFS using AWS Backup. Prior to AWS, Abrar was a Senior Director of Product Management at Veritas Technologies LLC, where he led the Data Protection (NetBackup) product management team.

Gurudath Pai

Gurudath Pai

Gurudath Pai is a Partner Solutions Architect at AWS, and he specializes in helping customers through our partners to architect SAP workloads on AWS. Gurudath has 14 years of industry experience assisting various customers worldwide to implement and architect SAP solutions.