How to copy files from one server to another droplet

December 2, 2014 9.3k views

Hi,

I broke my website and now I am trying to spin a new droplet and copy the files from one droplet to another.

Can anyone let me know how I can do this?

Thanks a lot.

Mark

4 Answers

It's pretty easy. You can use scp to transfer your files over ssh.

scp -r /path/to/my/files root@0.0.0.0:/path/on/remote/droplet

Of course you will need to replace 0.0.0.0 with your new droplet's IP and update the paths included above. This command would copy everything in /path/to/my/files to the directory /path/on/remote/droplet on the other droplet.

  • Hi Ryan,

    If I'm using another port, where can I put it into that command line?

  • To scp to a different port (2222 in this example) you can use the -P flag:

    scp -P 2222 -r /path/to/my/files root@0.0.0.0:/path/on/remote/droplet
    

Does this also copy the mysql database?

What if the data to be transferred is around 30 GB + ? What do you suggest ? Lets say i am trying to copy from softlayer to a droplet?

Have another answer? Share your knowledge.