Add to Favourites Add to Favourites    Print this Article Print this Article

Pulling data from a remote directory with rsync

Say you've got a User with massive amounts of data in:


The easier way to transfer the data is to:
1) Create the backup file without the Domains Directory:
Admin Level -> Admin Backup/Transfer -> Create Backup
Except in the "What" section, de-select the "Domains Directory" option, and create the backup.
This will create a tar.gz backup file, without /home/username/domains, allowing the tar.gz to be much smaller.

2) Transfer and restore the User's tar.gz backup file normally.

3) Since we've skipped the domains directory, we must transfer that data manually.  Rsync is the best tool to do this.
- Login to the new box (B), where the data is being transferred to.
- In ssh, as root (or the User you're transferring, if you want, but they need ssh access), type:

rsync -ave 'ssh -p 22' /home/username/domains/

where 22 can be replaced with a different port number, and is replaced with the IP of the old server (A).  Watch the data fly by, as it's being pulled from the other server to this one.

For increased security, you could enable SSH on the old server (A) for the User being transferred, and change "ssh -p 22" to be ssh -l username -p 22. The will ensure that only user-level access is used when reading files from A. You'd need to know the password of that User.

Was this answer helpful?

Also Read