In addition to using Google Workspace Migration for Microsoft Exchange (GWMME) on your Windows desktop, you can run GWMME using the command-line interface.
Before you begin
Open a command prompt and enter cd followed by the location of your GWMME installation in double quotation marks, for example, cd "C:\Program Files\Google\Google Workspace Migration".
The default locations are:
- C:\Program Files\Google\Google Workspace Migration (32-bit system)
- C:\Program Files (x86)\Google\Google Workspace Migration (64-bit system)
You might be prompted to enter your Exchange administrator username and password.
Required commands for your migration
The commands should be entered on a continuous single line. Any line breaks visible here are for readability only.
Expand section | Collapse all & go to top
Migrating from ExchangeExample 1: Migrate using an administrator profile
ExchangeMigration.exe
--nouse_gui
--exchange_profile_name="Exchange admin profile"
--filename="filename containing user list"
--service_account_json_path="json file path"
--google_admin="admin email address"
--google_domain="Google domain name"
Example 2: Migrate using server & administrator details
ExchangeMigration.exe
--nouse_gui
--source_server="exchange-server hostname"
--exchange_admin_login="Exchange server admin account"
--filename="filename containing user list"
--service_account_json_path="json file path"
--google_admin="admin email address"
--google_domain="Google domain name"
For more information about transferring Exchange data, go to Migrate data from Exchange.
ExchangeMigration.exe
--nouse_gui
--enable_imap
--filename="filename containing user list"
--service_account_json_path="json file path"
--imap_security="security number"
--imap_port="port number"
--imap_path_prefix="path prefix"
--imap_server_type="server type"
--source_server="IMAP server hostname"
--google_admin="admin email address"
--google_domain="Google domain name"
For administrator-mode migrations from Cyrus also use:
--imap_admin_id="Cyrus IMAP admin"
--imap_admin_password="Cyrus admin password"
For more information about transferring email data from Google or IMAP-based accounts, go to Migrate mail from Google Accounts or IMAP.
Example 1: Migrate messages to Gmail
ExchangeMigration.exe
--nouse_gui
--filename="filename containing user list"
--service_account_json_path="json file path"
--google_admin="admin email address"
--google_domain="Google domain name"
--pst_base_folder="PST folder name"
Example 2: Migrate messages to Google Vault
ExchangeMigration.exe
--nouse_gui
--filename="filename containing user list"
--service_account_json_path="json file path"
--google_admin="admin email address"
--google_domain="Google domain name"
--pst_base_folder="PST folder name"
--migrate_to_vault
For more information about transferring PST files, go to Migrate data from PST files.
Example 1: Use mapping mode to migrate public folders (recommended). This mode uses a mapping file to map the public folder to the group in Groups. Because group email addresses often don't match public folder names, most organizations use mapping mode.
ExchangeMigration.exe
--nouse_gui
--filename="filename containing user list"
--service_account_json_path="json file path"
--google_admin="admin email address"
--google_domain="Google domain name"
--public_folder_mapping_file="path to mapping file"
--enable_public_folder_migration
Example 2: Use default mode to migrate public folders. In this mode, you don't need a mapping file. Instead, GWMME compares folder and group names. The mapping is established when the public folder name directly matches the group name. For example, TPS reports/tps-reports maps to the group [email protected].
ExchangeMigration.exe
--nouse_gui
--exchange_profile_name="Exchange admin profile"
--service_account_json_path="json file path"
--google_admin="admin email address"
--google_domain="Google domain name"
--enable_public_folder_migration
For more information about transferring public folders, go to Migrate from public folders.
All GWMME arguments
Enter an argument on a single line and precede the argument with a double dash (--). Some arguments require additional parameters. Enter the parameters preceded by an equal sign and enclosed in double quotation marks.
Expand section | Collapse all & go to top
A—EArgument & description | Parameter |
---|---|
Specifies the end date for calendar events you want to migrate. Events that take place after this date aren't migrated. Example: --calendar_migration_end_date="2020-01-01" |
Date in YYYY-MM-DD format |
Specifies the start date for calendar events you want to migrate. Calendar events before this date aren't migrated. Example: --calendar_migration_start_date="2018-01-01" |
Date in YYYY-MM-DD format |
Specifies the prefix to attach to all labels in Gmail. Example: --custom_label_prefix="migrated-" |
Customized prefix that is attached to labels |
Specifies the end date for email messages that you want to migrate. Messages after this date aren't migrated Example: --email_migration_end_date="2020-01-01" |
Date in YYYY-MM-DD format |
Specifies the start date for email messages that you want to migrate. Messages before this date aren't migrated. Example: --email_migration_start_date="2018-01-01" |
Date in YYYY-MM-DD format |
Enables calendar event fan-out for calendar migration. |
No parameter required |
Enables hidden MAPI (Exchange or PST) folder migration. |
No parameter required |
Enables migration from an IMAP server rather than from an Exchange server. |
No parameter required |
Enables mbox logging. Messages that can't be migrated due to Gmail file size or type restrictions are written to a user-specific mbox file. The mbox file is located in the GWMME trace logging folder path (for example, %localappdata%\Google\Google Apps Migration\Tracing\ExchangeMigration\mbox\[email protected]). For details about Gmail message restrictions, go to File types blocked in Gmail. |
No parameter required |
Enables GWMME migration from Exchange public folders to Google Groups. For details, go to Migrate public folders. Note: You can't run a migration for both users and public folders at the same time. |
No parameter required |
Enables calendar resource migration. |
No parameter required |
Specifies the sign-in name for the Exchange server administrator account. Use this argument in conjunction with --source_server. Example: --exchange_admin_login="administrator" |
Sign-in name for the Exchange server admin account |
Specifies the name of the Outlook profile you want to use to connect to your Exchange server. Specify an administrator profile on the same machine that runs GWMME. If you use this argument, do not use:
Example: --exchange_profile_name="exch_migration_admin" |
Name of an existing Outlook profile |
Excludes messages based on the message class. This argument is useful when excluding stubbed messages from an archiving solution. GWMME doesn't support the remigration of unstubbed messages. The recommended approach is to exclude stubbed messages and then, once the stubbed messages are fully rehydrated, migrate the messages in a second run of GWMME. Example: --exclude_message_classes="ipm.note.eas,ipm.note.1" |
Comma-separated list of excluded classes (no spaces between list items) |
Excludes top-level folders based on folder name. Example: --exclude_top_level_folders="Deleted Items,Drafts" |
Comma-separated list of top-level folders (no spaces between list items) |
Argument & description | Parameter |
---|---|
Includes the data belonging to the usernames specified in the CSV file. If you use this argument, do not use --migration_usernames. Example: --filename="C:\Documents and Settings\users.csv" |
Path to the CSV file of usernames |
Clears the IDs of secondary calendars before you remigrate data. When you remigrate calendar data, GWMME creates new secondary calendars with unique IDs. Doing so avoids event conflicts. Note: Use this argument before you remigrate data. For details, go to Migrate content again. |
No parameter required |
Reruns the migration on all items, rather than only on items that weren't successfully migrated. By default, if a migration was interrupted, the next migration starts at the point where the previous migration stopped. You can use this parameter to run the migration again from the beginning. If you use this option, duplicate email is filtered out, previously migrated calendar events are ignored (but might get duplicated in some cases), and previously migrated contacts are duplicated. |
No parameter required |
Sets the event owner for calendar resources. If an event doesn't have an owner, GWMME sets the nominated administrator as the event owner. The user must have full access to resource calendars. Example: --google_admin="[email protected]" |
Email address of the nominated event owner for resource calendars |
Specifies the Google Workspace domain where you're migrating data. Example: --google_domain="example.com" |
Google Workspace domain |
Displays a list of the arguments for ExchangeMigration.exe. |
No parameter required |
Specifies the name of the file that has complete mapping list. Use the CSV mapping file that contains user and calendar address mappings. For details, go to Create CSV files for your migration. Examples: --id_mapping_file="resources.csv" |
File name |
Specifies the Cyrus IMAP administrator who has access to all IMAP accounts on the server. Use with --imap_admin_password. Example: --imap_admin_id="[email protected]" |
Cyrus administrator's email address |
Specifies the Cyrus IMAP administrator's password. Use with --imap_admin_id. Example: --imap_admin_password="password" |
Cyrus administrator's password |
Specifies the path prefix for user folders on an IMAP server. Enter the IMAP folders' path prefix that is common to all folders. The path prefix is usually the IMAP namespace for the folder names. For example, if the IMAP folder listing for a user is, INBOX, INBOX.Sent, and INBOX.Drafts, then INBOX is the path prefix. Typical values of path prefix are INBOX for Cyrus and Courier or none (leave the field blank) for GroupWise IMAP, Gmail, and Dovecot. Example: --imap_path_prefix="INBOX" |
Path prefix for user folders |
Specifies the port number for the IMAP server. Example: --imap_port="143" |
Port number |
Specifies the security option you want to use. Use one of the following codes:
Example: --imap_security="1" |
One-digit code |
Specifies the type of IMAP server you're migrating from. Server types are Exchange, GroupWise, Gmail, Cyrus, Courier, Dovecot, Zimbra, and unsupported. The default is unsupported. Note: If you specify an incorrect server type, the performance of the migration might be affected. Example: --imap_server_type="Gmail" |
Type of IMAP server |
Migrates email to Google Vault. Messages are uploaded to the user’s account and marked as deleted. Labels are not created in the user’s inbox. Note the following restrictions:
|
No parameter required |
Specifies the list of users for migration. If you use this argument, don't use --filename. Example: --migration_usernames="user1,user2,user3" |
Comma-separated list of users (no spaces between items) |
Argument & description | Parameter |
---|---|
Runs the migration without including calendar data. |
No parameter required |
Runs the migration without including contact data. |
No parameter required |
Runs the migration without including email data. |
No parameter required |
Prevents GWMME from generating migration reports, which show any message errors that occur during a migration. Skipping migration reports can improve the performance of a migration. |
No parameter required |
Runs the migration without requiring a mapping file. All mapping data is defined in the list of users if you use the --id_mapping_file argument. |
No parameter required |
Specifies that a prefix won't be added to labels when migrating from PST files. By default, the name of the PST file is added as a prefix to labels and calendars created during the migration. |
No parameter required |
Runs GWMME using the command line. Graphical user interface (GUI) mode is the default. |
No parameter required |
Closes GWMME without you needing to press the Enter key when the migration is run from the command line. |
No parameter required |
Specifies the number of users you want to migrate concurrently. A separate thread is opened for each user. The default is 25 threads. Example: --num_threads="20" |
Number of users |
Specifies the directory that contains the PST files for migration. GWMME migrates all PST files in the subfolders of the specified folder. If you use this argument, do not use:
Example: --pst_base_folder="C:\pst" |
Directory that contains PST files |
Specifies the mapping file name. The mapping file maps Exchange public folder paths to Google Groups email addresses. For details, go to Migrate public folders. Example: --public_folder_mapping_file="public_folder_mapping.csv" |
Mapping file name in CSV format |
Specifies the number of retries if a temporary failure occurs, such as a busy server timeout. The default is 10. Example: --retry_count="5" |
Number of retries |
Runs the exhaustive pre-migration diagnostics, which validates server connectivity, authentication, access to accounts, and the entire user list. |
No parameter required |
Specifies the path to the service account credentials file. For instructions on obtaining this file, go to Authorize GWMME for your account. Example: --service_account_json_path ="C:\Users\admin\privatekey.json" |
Path to the service account credentials file |
Specifies the Exchange or IMAP server IP address or fully qualified domain name. In Exchange migrations, use this in conjunction with --exchange_admin_login. If you use this argument, do not use --exchange_profile_name. Example: --source_server="mailserver.example.com" |
Server IP address or fully qualified domain name |
Specifies that messages are migrated without labels. |
No parameter required |
Instructs GWMME to look at existing events already migrated to Google Calendar and modifies the events by translating the email address of the Exchange resource to that of the matching Google Workspace resource. Many administrators choose to migrate users first and calendar resources second. If you choose to migrate calendar resources second, configure GWMME to remigrate the users' calendar data. Do this by using --translate_conflicting_events. |
No parameter required |
Google, Google Workspace, and related marks and logos are trademarks of Google LLC. All other company and product names are trademarks of the companies with which they are associated.