0

I have 2 Linux Centos Servers.

The First one is 6.7 and the second one is 7.

How can I transfer all files and folders from /home/sv1/public_html from server 1 to /home/sv2/public_html in server 2 ?

The data is 6TB and I can't move them using FTP.

Thanks

Froggiz
  • 3,043
  • 1
  • 19
  • 30
  • 3
    For that large of a transfer using a copy that can be restarted would be preferable. `rsync` is a common copy that has that characteristic while `scp` does not. – Brian Nov 22 '15 at 21:58
  • a friend of mine suggested SCP and he said the copy would be perfect and no files would be damaged using SCP but I consider rsync too . thanks for the answer – Ali Mastermovie Nov 22 '15 at 22:04
  • 1
    @AliMastermovie Data corruption in such a transfer depends more on the hardware you are using than the software. – kasperd Nov 22 '15 at 22:25

3 Answers3

2

Use rsync in server1

rsync -dr /home/sv1/public_html -e ssh user@server2:/home/sv2/public_html -v

This will take a while since it's 6GB. You should consider using screen and keep it working while you aren't active on the server.

MDMarra
  • 100,734
  • 32
  • 197
  • 329
James John
  • 161
  • 4
  • thanks for the answer . the data is 6 TB not GB . any how by user@server2 you mean root@ip ? BTW I want the files to remain on the first server after moving . Is that ok ? – Ali Mastermovie Nov 22 '15 at 22:02
  • You are copying into the home directory of sv2, so say `sv2@ip`. The files will remain. Use `screen` so as to keep it working in background – James John Nov 22 '15 at 22:04
  • should the destination server have port 22 ? It's now set on different ssh port . – Ali Mastermovie Nov 22 '15 at 22:38
  • Without specifying the port, ssh is taking the default port which is 22. If you are having it on another port like 50 then your command goes `rsync -dr /home/sv1/public_html -e ssh -p 50 user@server2:/home/sv2/public_html -v` – James John Nov 22 '15 at 22:41
  • ok the tansfer began , I didn't use screen command but I increased SSH timeout to 999999999 . Will this be ok ? – Ali Mastermovie Nov 22 '15 at 23:09
  • I suggested the screen in case you encounter connection issues, you may lost connection to server1 if its not a physical server. But if it is, then you're good :) – James John Nov 22 '15 at 23:49
1

Assuming a user on server2 with suitable privilege and the user1 on server1 having a suitable private key: on server1.

cd /home/sv2/public_html
scp -i /home/user1/.ssh/keyfile user@server1:/home/sv1/public_html .
user9517
  • 115,471
  • 20
  • 215
  • 297
0

You should consider using rsync, as it's more convenient for transfering such big amount of data, especially because rsync can continue partially transfered files (e.g. in case of network timeout).

rsync -avzP /home/sv1/public_html/ -e ssh user@server2:/home/sv2/public_html/

-a - archive mode (preserves permissions, ownership, etc.)

-v - prints verbose transfer status

-z - on-the-fly compression for faster transfer

-P - keeps partially transfered files in order to resume the transfer where it broke the last time.

Tubeless
  • 1,640
  • 14
  • 15