AWS – EFS Replication Guide

amazon-efsamazon-web-services

I'm looking to replicate an existing EFS to a new EFS and mount it to a cloned environment for testing purposes but can't seem to find any good information on it.

To clarify – I'll be replicating an EC2 instance as well and want to create a completely separate environment so the new EFS instance will be identical to the source EFS at a certain point in time, but does not need to stay in sync afterward.

Any thoughts?

The following link is a potential solution, but seems overly complicated. That said, it may be the best / only way it can be done:
https://aws.amazon.com/premiumsupport/knowledge-center/efs-file-sync-between-files/

Best Answer

This seems too simple... I'm not sure I've fully understood your question.

  1. Mount both EFS file systems to a single instance, likely your current instance.
  2. Use a copy command to copy the files to the new EFS file system.
  3. Disconnect the new file system from your instance
  4. Mount the new EFS file system to the new instance

Update

Here's some commands that have a pretty good chance of working. I took them from this page.

Mount the second file system

sudo mount -t efs -o tls fs-12345678:/ /mnt/efs2

Copy the files

sudo cp -r /mnt/efs /mnt/efs2/
Related Topic