Link to home
Start Free TrialLog in
Avatar of Nathan Riley
Nathan RileyFlag for United States of America

asked on

Download Files from one server to another

I'm trying to find a easy way to move from my old server to my new server.  I have about 30 gigs on my old server and I've purchased my new server.  What I'm trying to keep from doing is downloading all that data to my home computer then uploading it super slow to my new server.  Is there a way from SSH on my new server to pull the files from the old server?
Avatar of farzanj
farzanj
Flag of Canada image

One of the machines should have sshd running on it then you can use rsync.

What partitions do you want to do, I can give you the exact command

Which server has ssh daemon running on it

Use rsync -av.

Do you want to skip any folders, etc?
Avatar of Nathan Riley

ASKER

No I want to take everything from one to the other, but my home upload speed is only 100k/sec so that would take forever.  I figured their should be a way to use my servers with one another to do the transfer.  They both have SSH.  I'm not sure what SSHD is or rsync?  I thought I could just run some get command.
So you have ssh on the new server?

logon to the old server as root

The issue command

rsync -av /path  user@newServerIP:/path
Yes, you can connect them with a network cable.  Get to the old server and try doing

ssh root@IP_ADDRESS_OF_NEW_SERVER
Can  you do it?  If you want to copy everything, you can do

rsync -av /  root@newServerIP:/


But you may run into problems considering that you may overwrite some basic files/user accounts etc.  It would be better to skip some partitions or folders.
Ah, ok I see what you mean.  No the servers are at 2 different data centers so no luck connecting with network cables.  I will have to do the other commands.  I only want to copy the home folder now that you mention it.  All my websites and data are within it.  How can I use rsync to do this, should I do command from old or new server?  Is rsync even installed on them?  They are running CENTOS 5.5
SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you know the IP addresses of both machines OR the domain names?  This info goes after @ sign in rsync or ssh syntax.
Yes I will have the IP of both.  1 is up right now (old server).  The new one is still being setup so when I do get it I will try this out and get back to you.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One disadvantage to creating a tarball and then copying it over is that you will need space to save the tar file.  Depending on how much compression you get, to save 30Gb could take and additional 15Gb or more.  Also, if you have connection problems transferring the tarball, you have to start over again.  

Rsync is incremental and doesn't require extra disk space.  If the connection is broken, you can re-run rsync and it will copy the remaining files, skipping over the ones which are already copied.

On the other hand, rsync can be confusing.  The -n (dry run) option will not really tell you what it will copy.  And the nonsense about what a slash at the end of the path means always leaves me wondering if I have the command right.  If you have enough space on both servers and a reliable connection, use tar.