[PLUG] Moving/copying old home to new machine

Paul Heinlein heinlein at madboa.com
Tue Sep 5 16:42:52 UTC 2017


On Sun, 3 Sep 2017, Denis Heidtmann wrote:

> I am wanting to copy my home folder from my old machine to my new one.  I
> was planning on putting either the old or the new drive in a usb dock and
> copying everything over using cp -pr.  But web comments mention rsync.
> What are the risks/rewards of the various choices?

For a one-time copy of a small-ish directory tree, either will 
probably suffice.

If you experience a mid-copy failure, rsync won't recopy any files 
that have already been copies, whereas cp will just start again from 
the beginning.

As someone else mentioned, rsync can work over the network.

rsync over a network can handle the situation where your UID/GID on 
the source system is different from that on the destination.

Typically "cp" will be somewhat faster while rsync will be safer and 
more flexible.

Personally, I'm a fan of using tar over ssh for initial copies, 
because tar handles hard and soft links gracefully and quickly:

cd /home
tar cf - yourdir | ssh your.new.host "cd /home && tar xf -"
# if you're really seeking safety, then run sync too.
# XXX: note lack of trailing slash in source directory.
rsync -av  /home/yourdir  your.new.host:/home

Of course, that just muddies the water of your original question. :-)

-- 
Paul Heinlein
heinlein at madboa.com
45°38' N, 122°6' W


More information about the PLUG mailing list