Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, my current host is not providing me with a backup of my websites on my server, they're pissed 'cuz I've purchased a new server with someone else and they're ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    1

    Rsync Help

    Hi, my current host is not providing me with a backup of my websites on my server, they're pissed 'cuz I've purchased a new server with someone else and they're making me jump through hoops to get my data migrated.

    I'm new to server administration but I heard a little about Rsync and that may be the best way for me to move my sites (132GB) to my new server.

    Does anyone know where I can find a good tutorial for Rsync? I've been looking but haven't had much luck.

    If anyone can point me in the right direction I'd greatly appreciate it. Thanks and I hope to be more active in this forum

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    616

    intro to rsync

    Disclaimer: this is meant only as a tutorial.

    I got it running as a standalone daemon, electing to bypass the whole xinetd method. Running as a daemon: rsync --daemon --config /etc/rsyncd.conf. Stick that in like rc.local and it will start up on boot.

    config file looks something like this (for now). you may have to play with ownerships/permissions to get everything to work for you.
    Code:
    id file = /var/run/rsyncd.pid
    uid = nobody
    gid = users
    use chroot = yes
    read only = no
    
    hosts allow = *
    max connections = 0
    
    [updates]
    path = /home/rsync/updates
    Make sure the user you defined in UID has full permission to the path of the share(s) you set up in your config.

    Downloading from the share

    I got the share called updates. In order to rsync from it and put it in a specific folder I'd run:
    Code:
    rsync -av mynew.server.com::updates /path/to/folder
    I was able to successfully download it all. Now if I run the command again, it does nothing because the files have not changed.

    Upload

    Same principles apply, just reverse.
    Code:
    rsync -vr /path/to/folder mynew.server.com::updates
    You may have permissions error that require some tweaking. Have fun.

    NOTE: You should take your own measures to ensure nobody can get to your stuff either by using the Allow option in rsync, or use iptables to filter connections, or even setting up authentication in rsync.

  3. #3
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    Hi and welcome.

    This should get you started:
    - log into your "new" server via ssh
    - install rsync, if it is not already there
    - create a directory on a partition with enough space to hold the 132GByte
    - log in to your "old" server via ssh
    - become root ( or at least a user who has read rights to all your data files)
    - install rsync, if it is not already there
    - shutdown all services, especially DBs. This way, all your data becomes just static files.
    - screen
    - rsync -a --delete -e ssh <SOURCEDIR> <USER>@<NEWSERVER>:<DESTINATIONDIR>
    - detach from screen with <Ctrl> + <a>, <d>

    This will sync <SOURCEDIR> on the old server to <DESTINATIONDIR> on the new one over a secure ssh connection and utilizing rsync.

    Some Notes:
    - shutting down the services might need scheduling
    - the sync takes ressources. CPU, IO, Net
    - also consider the cost of transferring 136GByte. Two times actually. Old and new provider.
    You must always face the curtain with a bow.

  4. #4
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    scathefire was faster

    Two approaches, both possible.
    rsync over ssh takes more ressources, but you dont have to run a rsync server and also offers encryption.

    The rsync server approach will be faster and offers some nice options in rsyncd.conf
    You must always face the curtain with a bow.

Posting Permissions

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