Linux – How to transfer user accounts to a new Linux machine

linuxmigrationuser-management

I currently have a Linux box hosting our internal Subversion repository. Access to this repository is via svn+ssh with authenticating happening against user accounts on the machine. I have recently acquired a shiny, new box (also installed with Linux) and want to transition the subversion repository across to it (as it has more space across six disks configured using RAID 1+0).

What do I have to do to transfer all the user, group, and file information from the current machine to the new machine so as to minimise the impact on the current users of the repository? My current thoughts are to copy across the relevant entries from the /etc/passwd and /etc/group files (and shadow files?), and to copy the user folders in /home. Is there anything I am missing?

EDIT: Extra info. Old box is Ubuntu 8, new box is Ubuntu 9. There are about a dozen users and a dozen custom groups.

Best Answer

From a cyberciti.biz article:

Following files/dirs are required for traditional Linux user management:

  • /etc/passwd - contains various pieces of information for each user account

  • /etc/shadow - contains the encrypted password information for user's accounts and optional the password aging information.

  • /etc/group - defines the groups to which users belong

  • /etc/gshadow - group shadow file (contains the encrypted password for group)

  • /var/spool/mail - Generally user emails are stored here.

  • /home - All Users data is stored here.

You need to backup all of the above files and directories from old server to new Linux server.