Results 1 to 9 of 9

Thread: Moving Files from One Server to Another

  1. #1
    Join Date
    Jan 2007
    Beans
    14

    Moving Files from One Server to Another

    I'm moving my site to a new VPS and need to learn how to move the files from my current server to the new one. I'd rather not download everything to my computer and then re-upload everything... seems like a lot of wasted time. There has to be a way to copy between the two servers, but how? I have heard someone mention rsync... is that a program I could use? If so, how?

    I appreciated any help in this matter.

  2. #2
    Join Date
    Jun 2007
    Beans
    1,941

    Re: Moving Files from One Server to Another

    rsync would probably be the best method.

    Assuming you can scp between the boxes, you can rsync between the boxes.

  3. #3
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Moving Files from One Server to Another

    +1 to rsync.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  4. #4
    Join Date
    Jan 2007
    Beans
    14

    Re: Moving Files from One Server to Another

    What would be the best command line to use for this?

  5. #5
    Join Date
    Jun 2007
    Beans
    1,941

    Re: Moving Files from One Server to Another

    Quote Originally Posted by thunderclap View Post
    What would be the best command line to use for this?
    rsync is the command...

    Code:
    man rsync
    ^^ if you want to learn more about it.

  6. #6
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Moving Files from One Server to Another

    Here's an example,

    assuming you have ssh access to both server's, oldsrv.com being the old one,
    and the username is the same on both servers
    and the file tree to copy is /var/www
    login to the new one,

    rsync -av user@oldsrv.com:/var/www/* /var/www/

    It will login to oldsrv.com and prompt for auth, then build a file list and copy the content to the target on the current server.
    Last edited by BkkBonanza; March 11th, 2011 at 04:37 AM.

  7. #7
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    rsync

    Quote Originally Posted by BkkBonanza View Post
    Here's an example,

    assuming you have ssh access to both server's, oldsrv.com being the old one,
    and the username is the same on both servers
    and the file tree to copy is /var/www
    login to the new one,

    rsync -av user@oldsrv.com:/var/www/* /var/www/

    It will login to oldsrv.com and prompt for auth, then build a file list and copy the content to the target on the current server.
    +1 for rsync

    Be sure to encrypt the rsync connection, though.

    Code:
    rsync -e ssh -av user@oldsrv.com:/var/www/*  /var/www

  8. #8
    Join Date
    Jan 2007
    Beans
    14

    Re: Moving Files from One Server to Another

    I appreciate all the input. Everything moved quickly and easily. Thank you!

  9. #9
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Moving Files from One Server to Another

    Actually the -e option is only needed if you're using a different shell than ssh (which is the default) or if you need to specify non-default options like a non-standard port (22). rsync will use ssh by default which is always encrypted.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •