JP Vossen on 7 May 2013 13:58:28 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Moving user accounts

Date: Tue, 7 May 2013 15:03:06 -0400
From: "Eric H. Johnson"<>

I set up an Ubuntu computer for a senior center some years back and that
computer is now long overdue for an upgrade. The existing computer is
running Ubuntu 10.04 and has something the high side of 20 user accounts,
although about half are probably dormant. I would like to move those
accounts and associated data to a new computer running Ubuntu 13.04. The
users as a rule do not store very much  on the computer since they use it
primarily for browsing the web and email.

What is the easiest way to migrate these accounts to the new computer. Is
there a wizard? The only thing I found seemed like it was no longer being
maintained. As a rule, I do not know the passwords for the individual
accounts. Can I just copy the home folder, etc/passwd, etc/shadow, etc. or
will I run into problems if I do not regenerate the uids and gids.

In general I agree with all the previous comments, but there is something I haven't seen addressed yet. Since you said Ubuntu 13.04, a bunch of the .dotfiles & .dirs are going to be obsolete. What I am *not* sure of is how much that matters, if at all. In other words, there is going to be a bunch of Gnome2 cruft in there that Unity won't need or want or maybe like. I'm not clear how much of that is migrated in any way when you do an in-place upgrade, so again I may be worried about nothing.

Also, why the not-supported-very-long 13.04 (EoL 2014-01!) instead of 12.04 LTS (EoL 2017-04)?

And you understand that Unity may make everyone's head hurt? There are other options that will look more like Ubuntu 10.04, though for your use-case Unity may well be the better/simpler/friendlier option long-term. (We run all 12.04 LTS with a mix of Unity and Cinnamon.)

That said, I'd probably do something like:

tar czf /tmp/data.tgz /etc/passwd /etc/shadow /home
scp /tmp/data.tgz root@newmachine:/tmp

cd tmp
mkdir data && cd $_
tar xzf /tmp/data.tgz
mv home/* /home

Then manually merge user data:
	/tmp/data/etc/passwd --> /etc/passwd
	/tmp/data/etc/shadow --> /etc/shadow

I'd personally use the awesome 'meld' GUI diff/merge tool, but you can use 'vi' or whatever you are comfortable with too.

You might also explore tar's '--exclude' options, to exclude all the various cruft like .cache and .thumbnail and whatever other trash.

And if you need to nuke known-bad stuff, something simple like this might work:
	rm -rf /home/*/.somecruft

Worst case you can use 'find', but 'find' is an ugly beast. (A really, really useful one, but ugly.)

Good luck,
JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --