Perl – Migrating User Accounts From Old To New Linux Distribution
Migrating user accounts can be very troublesome when you have a large numbers of users. So, is always recommended to deploy active directory or LDAP to have a centralized authentication system.
If your organization don’t have AD or LDAP and have large portion of users needed to transfer from 1 to another server. Don’t worry, instead of manually key in all the records 1-by-1, there’s always a faster way to achieve this kind of process by using script.
I have written 2 Perl scripts to perform the migration.
- Perl - Migrate user account script (109) (run in old server) – migrate user accounts from old server and generate a library with all the captured user data.
- Sample library – Perl - Sample User Library (94)
- Perl - Setup User Account (176) (run in new server) – include the library generated by migrate_passwd.pl and add all the user_account to the new server.
Steps:
1) Download migrate_passwd.pl in the old server and run it
./migrate_passwd.pl /etc/passwd /tmp/accounts.pm
2) Then copy the /tmp/accounts.pm to the new server (put this file into the same directory of serversetup.pl)
3) Download serversetup.pl in the new server and run it
./serversetup.pl
4) Done







October 22nd, 2008 at 06:39
you are good programmer, and thanks for sharing, but i don't really need it~
hahaha
October 22nd, 2008 at 06:39
you are good programmer, and thanks for sharing, but i don't really need it~
hahaha
October 22nd, 2008 at 07:23
Who knows 1 day you might need it, haha..
October 22nd, 2008 at 07:23
Who knows 1 day you might need it, haha..
October 22nd, 2008 at 14:39
you are good programmer, and thanks for sharing, but i don't really need it~
hahaha
October 22nd, 2008 at 15:23
Who knows 1 day you might need it, haha..