1

I need to copy more than 300 GB files (most them are images) one EC2 instance to another EC2 instance, what will be the best method for doing this?

EBS Snapshot will be not work in my situation because I will be need only one directory copy.

3
  • 2
    EBS snapshot will work just fine. Take one, launch an EBS volume from it, remove the files you don't need.
    – ceejayoz
    Feb 15, 2018 at 15:19
  • In that case what will happen to source instace's OS, Webserver, PHP etc files? I don't need them also.
    – Mi2
    Feb 15, 2018 at 15:34
  • 3
    Nothing will happen to the source instance - your new EBS volume is a copy of the snapshot. You can then attach it to the instance (or another instance) as a secondary drive, mount it, and delete everything you don't need. Just make sure you're doing that on the right volume
    – ceejayoz
    Feb 15, 2018 at 15:37

1 Answer 1

2

In addition to the snapshot, you can also use the scp command. Depending on your environment, this may be problematic with large files, it's good to know the options. To transfer the file from the second instance (ec2-2) to first instance (ec2-1), run scp on ec2-1:

scp -i /Path-To-Key-File-for-ec2-2/key.pem ec2-user@Elastic-IP-of-ec2-2:/path/filename your/local-path-on-ec2-1/filename

If you have instances in different regions, its a bit more complex. Here's a guide on transferring data between AWS regions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .