Command Line Migrate

0 Likes
over 12 years ago
This tool is a perl script that will trigger an account to be migrated to a connected system.

This functionality is found in iManager in the DriverSet view, however, it is limited in functionality. In iManager you can select individual accounts to migrate or select by container. This is good if you want to do one or two or all users. What if, however, you have a list of 1,000 accounts spread across multiple containers? This tool addresses this problem while also making it easier to migrate 1 or 2 accounts, especially for those that live by the command line.

To run the script you must install perl (I use v5.10.0) and the perl-ldap module. The script is contained in the migrate.pl file. The migrate.conf file contains the ldap server parameters.

Syntax for migrate.conf:
$ldapServer                      = '192.168.1.1';
$ldapServerPort = '686';
$ldapUserDN = 'cn=brad,ou=People,o=novell';
$ldapUserPass = 'sneakyPassWord';
$ldapSearchBase = 'o=novell';



Syntax for migrate.pl:

# ./migrate.pl  


<uid> = the search criteria to be executed. It can return a single entry or multiple entries.

<Driver> = the name of the driver to migrate the account(s) across. The value does not have to be the complete driver name, but is should be unique so as to distinguish it from other drivers.

Examples:

To migrate a single account, cn=brad,ou=people,o=novell across the driver, cn=edir,cn=DriverSet,ou=services,o=novell execute the command:

# ./migrate.pl cn=brad eDir


To migrate all accounts that start with "b" across the eDir driver execute the command:

# ./migrate.pl cn=b* eDir


To migrate a bulk list of accounts across the eDir driver execute a shell script containing the list of commands to execute:

./migrate.pl cn=adam eDir
./migrate.pl cn=brad eDir
./migrate.pl cn=carol eDir



The code is free to use. Feel free modify to meet your specific needs or send me any suggestions.

Labels:

How To-Best Practice
Collateral
Comment List
Anonymous
Related Discussions
Recommended