Have you ever had a need to migrate current running Linux users from installation to another? That would be a simple task if the user count was low. But what happens when the user count is in the hundreds? What do you do then? If you’re not using LDAP, you know you will have to migrate the users’ data, passwords, etc from the old machine to the new. Believe it or not, this is just a matter of a few commands – not necessarily simple commands, but it’s not as complex as you would think.
In this article I am going to show you how to make this migration so your Linux users do not loose their data and their passwords are all retained.
What we migrating
The list is fairly simple:
- /etc/passwd - Contains information about the user.
- /etc/shadow - Contains the encrypted passwords.
- /etc/group - Contains group information.
- /etc/gshadow - Contains group encrypted passwords.
- /var/spool/mail - Contains users email (the location will depend upon the mail server you use).
- /home/ - Contains users data.
Unfortunately these files can not simply be copied from one machine to another – that would be too easy. Just make sure you enter the following commands correctly.