Transfer home directory?

der.hans PLUGd at LuftHans.com
Sat Sep 16 21:13:03 MST 2006


Am 16. Sep, 2006 schwätzte Alan Dayley so:

> Suppose you buy a new computer and want to transfer your /home/user
> directory from your old computer to the new one.  In this case both
> computers are running the same distro so that is not an issue.
>
> Is there anything different to doing this beyond the usual file transfer
> methods?  In other words, is there anything among the settings, etc. in a
> user's home directory that would break when used on different hardware?

Make sure user and group IDs match or are changed.

Check for crontabs and stuff in local mail directories.

Did you do anything in /usr/local/ or in /opt/?

Use tar to copy the files and you'll keep timestamps on both the files and
directories. unison, rsync, cpio and others generally don't have a way to
maintain directory timestamps.

Use --atime-preserve when untarring to keep the dir timestamps.

You can tar across the network.

Here are a few key lines out of a script I no longer use.

TARC="tar clvf - -C"
TARX="tar x --atime-preserve -pvf -"

ssh $HOST "/usr/bin/sudo $TARC ${fs} . 2>${RLOG}" | sudo $TARX >${LLOG} 2>${LLOG}.err

You can also just dd the partition onto the new disk :).

ciao,

der.hans
-- 
#  https://www.LuftHans.com/        http://www.CiscoLearning.org/
#  Join the League of Professional System Administrators! https://LOPSA.org/
#  Motorräder töten nicht. Motorräder werden getötet.


More information about the PLUG-discuss mailing list