Browse > Home / Perl / Migrating User Accounts From Old To New Linux Distribution

| Subcribe via RSS

Migrating User Accounts From Old To New Linux Distribution

October 22nd, 2008 Posted in Perl

Migrating user accounts can be very troublesome when you have a large numbers of users. So, is always recommend to deploy active directory or LDAP.

If your organization didn’t deploy centralized user database like AD & LDAP and have large portion of users needed to transfer from Old server to the new one. Don’t worry, you don’t need to manually key in all the records 1-by-1, there’s always a faster way to achieve this by using script.

I have written 2 perl scripts to perform the migration.

  • [Download not found] (run in old server) – migrate user accounts from old server and generate a library with all the captured user data.
    • Sample library – [Download not found]
  • [Download not found] (run in new server) – include the library generated by migrate_passwd.pl and add all the user_account to the new server.

Steps:

1)

Migrating user accounts can be very troublesome when you have a large numbers of users. So, is always recommend to deploy active directory or LDAP.

If your organization didn’t deploy centralized user database like AD & LDAP and have large portion of users needed to transfer from Old server to the new one. Don’t worry, you don’t need to manually key in all the records 1-by-1, there’s always a faster way to achieve this by using script.

I have written 2 perl scripts to perform the migration.

  • [Download not found] (run in old server) – migrate user accounts from old server and generate a library with all the captured user data.
    • Sample library – [Download not found]
  • [Download not found] (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

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • FriendFeed
  • PDF
  • Reddit
  • Twitter
  • you are good programmer, and thanks for sharing, but i don't really need it~

    hahaha
  • Who knows 1 day you might need it, haha..
blog comments powered by Disqus