Batch File and Command Line Migrations for Exchange Server 2003
Because Migration Wizard is a single-threaded application, to increase performance and speed of your migration, you can run your migration using a batch file process to migrate your data. This option is available only if you run Migration Wizard from the command line. You can use the command line reference and the batch files (with examples provided later in this topic) to increase the performance of your migration.
Command Line Reference
Use the following switches available in Migration Wizard to run your migration from the command line.
Syntax
Mailmig [/C:File [/A:Account] [/D: Domain name] [/P:Password] [/S] [/M] [/?/h/help]
Switches
Table 1 lists the command line switches.
Table 1 Command line switches
Switch | Description |
---|---|
/C:File |
The location of the control file. The control file is a text file containing parameters and their values, which are separated by commas. |
/A:Account |
The name of an account that has administrative privileges for the mailboxes that you are migrating. Note You can only use this switch if the source mailboxes are on an Exchange server. |
/D:Domain name |
The target address prevents your migrating mailboxes from initializing. Migration Wizard moves mailboxes in two stages. If mail comes into the mailbox before Migration Wizard initializes it, the mailbox is initialized, clone mode is cancelled and Migration Wizard switches to default mode. To prevent this, you can run Migration Wizard in batch (command-line) mode with the target address command. |
/P:Password |
The password for the administrator account. Note You can only use this switch if the source mailboxes are on an Exchange server. |
/F:Logging Mode |
In the event of a migration failure, you can use the log to determine which mailboxes moved successfully and which mailboxes failed to move, and then take appropriate action (Exchange migrations only). |
/S:Silent mode |
Silent mode. No error messages are displayed. All errors are written to the Event Log. |
/M:Clone mode |
Clone mode. Used for migrating from Exchange. |
/?/h/help |
Displays Help text. |
Examples
mailmig /M /C:d:\migrate\po72195.txt
mailmig /C:salespo.txt /A:admin /P:katmanduKatmandu
Note
Running Migration Wizard with /m only (for example, ..\mailmig /m) starts Migration Wizard in clone mode.
Result Codes
Depending on the success, the command line returns the following result codes:
0 = Success. No errors or warnings
1 = Warnings. No errors
2 = Errors. Possible warnings
Running Multiple Instances of Migration Wizard
Because Migration Wizard is a single-threaded application, to increase performance and speed of your migration, you can run Migration Wizard in multi-instance mode. This option is available only if you run Migration Wizard from a command prompt.
To run Migration Wizard in multi-instance mode, at a command prompt, type D:\Program Files\Exchsrvr\bin\mailmig.exe (where D:\Program Files is the drive on which Exchange 2003 is installed), and then click OK.
Control File Parameters
Table 2 lists the parameters used to set values in the control file.
Table 2 Parameters used to set values in the control file
Parameter | Use | Description |
---|---|---|
Mode No default |
Required when using the control file. Valid Settings: FILE, EXCHANGE, MSMAILPC, CCMAIL, NOTES, GRPWISE, GRPWISE5, ADSI, and IMAP. |
The mode for this migration. It must be the first line in the control file. Note Set Mode to FILE when importing migration files. |
Exchange 5.5 Default: TRUE |
Required when Mode is set to EXCHANGE. Valid Settings: TRUE means the migration is from an Exchange 5.5 server. FALSE means the migration is from an Exchange 2000 or Exchange 2003 server. |
Whether the source server is running Exchange 5.5 or Exchange 2000 or Exchange 2003. |
RestrictSearchtoSid Default: FALSE |
Optional when Mode is set to EXCHANGE or IMPORT ONLY FROM PST. Valid Settings: TRUE means to search for matching user objects based only on the object SID during the import phase of migration. FALSE means to accept all matches. |
Whether to match user objects based only on the object SID. |
SubjectFile No default |
Optional when Mode is set to EXCHANGE. Valid setting is the path and file name of a file that consists of lists of subjects (in Unicode format). |
Normalized subject text is checked for a prefix match against any of the input subjects. If a match is found, the message is not copied to the destination. The file must end with a carriage return character and a line feed character. |
ForcePwdChange Default: FALSE |
Optional Valid Settings: TRUE means that users must change their passwords. FALSE means that users do not have to change their passwords. |
Whether to force users whose accounts were migrated to change their passwords. |
Function Default: FULL |
Optional Used when Mode is set to MSMAILPC, CCMAIL, NOTES, GRPWISE, GRPWISE5, ADSI, or IMAP. Valid Settings FULL to perform a full migration (extract and import). EXTRACT to extract a user list file (MS Mail PC) or to extract migration files (Lotus cc:Mail, Lotus Notes, Novell GroupWise 4.x, Novell GroupWise 5.x, LDAP, and IMAP). IMPORT to perform an MS Mail (PC) import from a user list file. |
The migration function to perform. |
File No default |
Required when Mode is set to FILE, CCMAIL, NOTES, GRPWISE, GRPWISE5, ADSI, or IMAP. Function is set to EXTRACT, IMPORT, or FULL. Valid Settings: For IMPORT, specify the path and file name of the packing list or user list file. For EXTRACT or FULL, specify the path to the temporary directory to which migration files should be written (for CCMAIL, NOTES, GRPWISE, GRPWISE5, ADSI, or IMAP). For MSMAILPC EXTRACT, specify the path and filename of the new user list file to be created. |
The path and file name of the packing list or user list file, or the path to the temporary directory to which migration files should be written. |
Accounts No default |
Required when Mode is set to CCMAIL, NOTES, ADSI, IMAP, or MSMAILPC (when a user list file is not specified by File). If the Accounts keyword is not used, Migration wizard will migrate all accounts from the specified postoffice. Valid setting is a user list file. |
A user list file with a listing of accounts to be migrated. Users may be listed by alias, X.500 address, or SMTP address. For an alias list, the format of each entry must match the name format as it appears in the Full Name column of the Migration Wizard Account Migration page. Each name is on one line and is followed by a carriage return and line feed. For X.500 or SMTP address lists, each entry should start with X500: or SMTP:, then the address, followed by a carriage return and line feed. |
Mailbox Default: TRUE |
Optional Valid Settings: TRUE means mailboxes are created and messages are imported. FALSE means messages are imported to existing mailboxes but new mailboxes are not created. |
Whether to extract mailbox creation information and create the mailbox on Exchange. |
Default: TRUE |
Optional Ignored unless Mode is set to MSMAILPC, CCMAIL, NOTES, GRPWISE, GRPWISE5, or IMAP. TRUE | FALSE |
Whether to extract personal e-mail messages. |
Public Default: TRUE |
Required when Mode is set to FILE, MSMAILPC or CCMAIL. TRUE | FALSE |
Whether to extract shared folders, bulletin board, or forum information. Note When you import from a file, if you are not migrating public folders, you must set this attribute to FALSE or an error will result. |
PAB Default: TRUE |
Optional Ignored unless Mailbox is set to MSMAILPC or CCMAIL. TRUE | FALSE |
Whether to extract personal address book (PAB) entries and PAB distribution lists. |
Schedule Default: TRUE |
Optional Ignored unless Mode is set to MSMAILPC, NOTES, GRPWISE, or GRPWISE5. TRUE | FALSE |
Whether to extract schedule (calendar) information. |
EmailStart Default: Jan 01, 1601 |
Optional Ignored unless Mode is set to MSMAILPC, CCMAIL, NOTES, ADSI, GRPWISE, or GRPWISE5. Valid Setting: Must be in the following date and time format: YYYYMMDDHHMMSS. |
The earliest (start) date for filtering the e-mail messages that are moved. Messages without dates are always migrated. |
EmailEnd No default |
Optional Ignored unless Mode is set to MSMAILPC, CCMAIL, NOTES, ADSI, GRPWISE, or GRPWISE5. Valid Setting: Must be in the following date and time format: YYYYMMDDHHMMSS. To ensure migration of the contents of the Drafts folder, set the EmailEnd parameter to a time after the migration will be completed. For example, if you anticipate that the migration will end at 20050803220000, you could set EmailEnd to 20050803221000 (the estimated end time plus 10 minutes). |
The end date for filtering which e-mail messages are moved. Messages without dates are always migrated. |
ExchStoreDN No default |
Required when Function is not set to EXTRACT. Valid setting is a distinguished name. |
The distinguished name of the Exchange mailbox store in which user mailbox stores are to be created. Example: CN=New Mailbox Store,CN=My Storage Group,CN=InformationStore,CN=MYSERVER,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=FirstAdminGroup,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=microsoft,DC=com |
Container No default |
Required when Function is not set to EXTRACT. Valid Setting: Must be formatted as follows: OU=New Users,DC=MyDomain, DC=microsoft,DC=com New Users is a subcontainer of MyDomain. |
The distinguished name of the organizational unit (container) in which new Microsoft Windows® accounts are to be created. You can get the full distinguished name from an Lightweight Directory Access Protocol (LDAP) viewer such as Ldp.exe or Adsivw.exe. |
NTAcconts Default: RANDOM |
Optional; ignored unless Mailbox is set to TRUE. Valid Settings: RANDOM creates Windows accounts and generate random passwords. ALIAS creates Windows accounts and uses the Exchange e-mail alias as the initial password. |
Whether to create Microsoft Windows NT® accounts for new users and which value to use as the Windows NT account password. |
Postoffice No default |
Required if Mode is set to MSMAILPC, CCMAIL, GRPWISE, ADSI, or IMAP. Valid setting is a universal naming convention (UNC) path or a mapped drive location. However, if you are migrating Exchange mailboxes, the valid setting is the name of the Exchange server. |
The full path to the post office. |
GWDomain No default |
Required if Mode is set to GRPWISE5. Valid setting is either a UNC path or a mapped drive location. |
The path to the GroupWise 5.x domain. |
POName No default |
Required if Mode is set to CCMAIL, NOTES, or GRPWISE5. |
The full name of a cc:Mail, Notes, or a GroupWise 5.x post office. The Notes post office should be in the form Notes Server/Domain. The GroupWise post office is in the domain stated in the GWDomain value. |
DefFldPerms Default: NONE |
Optional if Public is set to TRUE. Valid options are None, Author, and PubEditor. |
Used to assign default access permissions to all users for migrated shared information. |
FldOwner No default |
Required if Public is set to TRUE. |
Distinguished name of the account that will own the public folder. You should use the Exchange 5.5 version distinguished name rather than the Microsoft Active Directory® directory service distinguished name. Example: /o=Microsoft/ou=London/cn=Recipients/cn=TheOwner. |
ImportDestination Default: SERVER |
Optional Ignored unless Mode is set to FILE, MSMAILPC, EXCHANGE, CCMAIL, NOTES, GRPWISE, GRPWISE5, or IMAP. Valid Settings: SERVER migrates information to the Microsoft Exchange Information Store service. PST migrates information to personal folder (.pst) files and personal address book (.pab) files. |
Specifies the destination store for migrated data. Note Public folder data does not migrate to .pst files. |
PSTPath Note If you use the keyword ImportDestination, you can select the location where the PST file will be placed. If you don't specify the location, the PST file will be placed in the root directory of the drive where Exchange is installed. |
Required if ImportDestination is set to PST. Valid setting is path name. |
The fully qualified path to the directory where personal folder (.pst) files are created. |
GWUserGRPName No default |
Required if Mode is set to GRPWISE. |
The name of the Novell GroupWise group whose members are to be migrated. |
SchdStart Default: Jan 01, 1601 |
Optional Ignored unless Mode is set to NOTES, GRPWISE, or GRPWISE5. Valid settings are in the following date and time format: YYYYMMDDHHMMSS. |
The earliest (start) date for filtering which calendar data is moved. Information without dates is always migrated. |
SchdEnd Default: Current date |
Optional Ignored unless Mode is set to NOTES, GRPWISE, or GRPWISE5. Valid settings are in the following date and time format: YYYYMMDDHHMMSS. |
The end date for filtering the calendar data that is moved. Messages without dates are always migrated. |
Phone Default: TRUE |
Optional Ignored unless Mode is set to GRPWISE or GRPWISE5. TRUE | FALSE |
Whether to migrate phone messages. |
Appointments Default: TRUE |
Optional; ignored unless Mode is set to NOTES, GRPWISE, or GRPWISE5. TRUE | FALSE |
Whether to migrate appointments. |
Notes Default: TRUE |
Optional Ignored unless Mode is set to GRPWISE or GRPWISE5. TRUE | FALSE |
Whether to migrate notes. |
Tasks Default: TRUE |
Optional Ignored unless Mode is set to GRPWISE or GRPWISE5. TRUE | FALSE |
Whether to migrate tasks. |
GWRTF Default: TRUE |
Optional Ignored unless Mode is set to GRPWISE. Valid Settings: TRUE means messages are migrated in Rich Text Format (RTF). FALSE means messages are migrated in American National Standards Institute (ANSI) format. |
Indicates whether messages are migrated in RTF. |
IniFile Depends on the version of Lotus Notes installed. |
Optional Ignored unless Mode is set to NOTES. |
The path to the Notes.ini file. |
DocLinkConversion Default: RTF |
Optional Ignored unless Mode is set to NOTES. Valid Settings: URL to convert document links to URL shortcuts within the message. OLE to convert document links to OLE attachments within the message. RTF to convert document links to RTF attachments within the message. |
How Notes document links are converted within the messages being migrated. |
Secure Default: FALSE |
Optional Ignored unless Mode is set to ADSI. |
Whether to use Secure authentication. |
Encryption Default: FALSE |
Optional Ignored unless Mode is set to ADSI or IMAP. |
Whether messages are encrypted. If set to TRUE, Secure Sockets Layer (SSL) is used to migrate the contents of the mailboxes. In this case, make sure you select the correct value for Port. |
Port Default:
|
Optional Ignored unless Mode is set to ADSI or IMAP or EXCHANGE. |
The port number. |
! |
Optional |
A comment delimiter. Must be the first value in the line. |
TargetDC |
Optional Ignored if mode is not Exchange |
Common name (CN) or fully qualified domain name (FQDN) of the target domain controller acting as global catalog server to which Migration Wizard should bind. |
SourceDomain |
Optional Ignored if Mode is EXCHANGE and Exch55 equal True and if Mode is not EXCHANGE. |
CN or FQDN of the source Active Directory domain to which Migration wizard should bind. |
InetOrgPerson Default: FALSE |
Optional If InetOrgPerson equals TRUE, Migration Wizard creates an Active Directory object with an object class that equals InetOrgPerson. |
By default, object class is OrganizationalPerson. |
ExchStore No default |
Required if ExchStoreDN is not specified. Valid setting is a mailbox database name. |
The common name of the Exchange mailbox database that will contain the new migrated mailboxes. |
Sample Control Files
You can use the following sample control files with the /C switch of the migration command-line utility.
Microsoft Mail for PC Networks: importing data with a user list.
Note
This is a sample control file for MS Mail migrations.
Mode,MSMAILPC
Function,import
File,\\Server1\MSMail\CompanyPO.csv
Public,False
PostOffice,\\Server1\MSMail\CompanyPO\MailData
Container,OU=MailMig,DC=London,DC=Domain,DC=com
ExchStoreDN,CN=MyPrivateInfoStore,CN=InformationStore,CN=Server1,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=MyVeryFirstOrg,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain,DC=com
NTAccounts,Alias
Email,true
Schedule,true
PAB,true
Exchange: using the command line to migrate from Exchange 5.5.
Note
This is a sample control file for Exchange 5.5 mailbox migrations.
Mode,exchange
Accounts,c:\ntstemp\accounts.txt
PostOffice,mig55
Exch55,True
ExchStoreDN,CN=Mailbox Store (MIG-SOURCE-EN),CN=First Storage Group,CN=InformationStore,CN=MIG-SOURCE-EN,CN=Servers,CN=First Administrative Group, CN=Administrative Groups, CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mig-source,DC=extest,DC=contoso,DC=com
Container,OU=Test,DC=mig-source,DC=extest,DC=contoso,DC=com
TargetDC,migDC
Exchange: using the command line to migrate from Exchange 2000 or Exchange 2003.
Note
This is a sample control file for Exchange 2000 or Exchange 2003 mailbox migrations.
Mode,exchange
Exch55,False
SourceDomain,migSourceDomain
PostOffice,mig2000
Accounts,c:\ntstemp\accounts.txt
ExchStoreDN,CN=Mailbox Store (MIG-SOURCE-EN),CN=First Storage Group,CN=InformationStore,CN=MIG-SOURCE-EN,CN=Servers,CN=First Administrative Group, CN=Administrative Groups, CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mig-source,DC=extest,DC=contoso,DC=com
Container,OU=Test,DC=mig-source,DC=extest,DC=contoso,DC=com
TargetDC,migDC.mig-source.extest.contoso.com
Lotus:cc:Mail: importing migration files to .pst files.
Note
This is a sample control file for cc:Mail migrations.
Mode,ccmail
Function, FULL
ImportDestination,Server
ExchStoreDN,CN=Mailbox Store (AMA),CN=First Storage Group,CN=InformationStore,CN=AMA,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=AMA,DC=extest,DC=contoso,DC=com
Container,OU=mig (AMA),DC=AMA,DC=extest,DC=contoso,DC=com
File,d:\temp
PostOffice,w:\ccmailpo
POName,smtpPO
Public,True
FldOwner,/o=First Organization/ou=First Administrative Group/cn=Recipients/cn=Administrator
DefFldPerms,author
Novell GroupWise 4.x: extracting data to migration files.
Note
This is a sample control file for GroupWise migrations.
Mode,grpwise
Function,extract
Postoffice,E:\large\mainpo
File,E:\temp\
GWUsergrpname,testers
Email,True
Phone,True
Appointments,True
Notes,True
Tasks,True
SchdStart,19950101000000
SchdEnd,20000101000000
EmailStart,19950101000000
EmailEnd,20000101000000
Novell GroupWise 5.x: one step migration to a server.
Note
This is a sample control file for GroupWise migrations.
Mode,grpwise5
Function,Full
Mailbox,True
ImportDestination,Server
File,e:\temp\
GWDomain,k:\SYS\GrpWise\NYCDomain
POName,Manhattan
ExchStoreDN,CN=Mailbox Store (FIRST),CN=First Storage Group,CN=InformationStore,CN=FIRST,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=ThirtyTwoLettersThirtyTwoLetters,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=London,DC=extest,DC=contoso,DC=com
Container,OU=Finance,DC=London,DC=contoso,DC=com
NTAccounts,Alias
ForcePwdChange,True
Email,true
Appointments,true
Notes,false
Tasks,true
SchdStart,19950101000000
SchdEnd,20000101000000
EmailStart,19950101000000
EmailEnd,20000101000000
Novell GroupWise 5.x: one step migration to .pst files.
Note
This is a control file for GroupWise migrations.
Mode,GrpWise5
GWDomain,k:\SYS\GrpWise\NYCDomain
POName,Manhattan
ImportDestination,PST
PSTPath,c:\psts
File,c:\temp
Schedule,False
Notes,False
Tasks,True
Lotus Notes: one step migration to a server (all users in a post office).
Note
This is a control file for Lotus Notes migrations.
Mode,Notes
File,c:\temp
ExchStoreDN,CN=NotesUsers,CN=First Storage Group,CN=InformationStore,CN=Exchange6,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DomainXYZ,DC=CompanyXYZ,DC=com
Container,OU=NotesFolks,DC=DomainXYZ,DC=CompanyXYZ,DC=com
INIFile,C:\Lotus\Notes\notes.ini
POName,LocalPostOffice/Topeka/US
SchdStart,19980101000000
EmailStart,19980101000000
DocLinkConversion,OLE
NTAccounts,Random
Internet directory (LDAP by means of Active Directory Service Interfaces [ADSI]): one step migration to a server (all users in an ADSI container).
Note
This is a control file for LDAP migrations.
Mode,ADSI
Function,Full
File,e:\temp
Accounts,e:\test\accounts.txt
Mailbox,True
ExchStoreDN,CN=Mail,CN=Mail Sack,CN=InformationStore,CN=Store,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=City01,DC=City02,DC=contoso,DC=com
Container,ou=users2,dc=City01,dc=City02,dc=contoso,dc=com
PostOffice,web3/o=contoso.com
NTAccounts,Alias
ForcePwdChange,False
Secure,False
Encryption,False
Port,389
IMAP4: extract only (all users in the imapusr.csv file.
Note
This is a control file for IMAP4 migrations
Mode,IMAP
Function,Full
File,e:\temp
Accounts,e:\temp\ADSI.001\imapusr.csv
Mailbox,True
ImportDestination,Server
Home-Server,Mig-Source-En2
ExchStore,Mailbox Store (Mig-Source-En2)
Container,OU=new,OU=test,DC=mig-source,DC=extest,DC=contoso,DC=com
NTAccounts,Alias
ForcePwdChange,False
Email,True