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 tps-reports@solarmora.com.
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—E --calendar_migration_end_date
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"
--calendar_migration_start_date
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"
--custom_label_prefix
Specifies the prefix to attach to all labels in Gmail.
Example: --custom_label_prefix="migrated-"
--email_migration_end_date
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
--email_migration_start_date
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"
--enable_calendar_fanout
Enables calendar event fan-out for calendar migration.
--enable_hidden_folders_migration
Enables hidden MAPI (Exchange or PST) folder migration.
--enable_imap
Enables migration from an IMAP server rather than from an Exchange server.
--enable_mbox_logging
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\user@domain.com.mbox).
For details about Gmail message restrictions, go to File types blocked in Gmail .
--enable_public_folder_migration
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.
--enable_resource_migration
Enables calendar resource migration.
--exchange_admin_login
Specifies the sign-in name for the Exchange server administrator account. Use this argument in conjunction with --source_server.
If you use this argument, don't use --exchange_profile_name.
Example: --exchange_admin_login="administrator"
--exchange_profile_name
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:
- --source_server
- --pst_base_folder
- --exchange_admin_login
Example: --exchange_profile_name="exch_migration_admin"
--exclude_message_classes
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"
--exclude_top_level_folders
Excludes top-level folders based on folder name.
Example: --exclude_top_level_folders="Deleted Items,Drafts"
--filename
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"
--force_clear_google_calendar_ids_on_remigration
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 .
--force_restart
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.
--google_admin
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="admin@example.com"
--google_domain
Specifies the Google Workspace domain where you're migrating data.
Example: --google_domain="example.com"
--help
Displays a list of the arguments for ExchangeMigration.exe.
--id_mapping_file
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"
--imap_admin_id
Specifies the Cyrus IMAP administrator who has access to all IMAP accounts on the server. Use with --imap_admin_password.
Example: --imap_admin_id="admin@example.com"
--imap_admin_password
Specifies the Cyrus IMAP administrator's password. Use with --imap_admin_id.
Example: --imap_admin_password="password"
--imap_path_prefix
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"
--imap_port
Specifies the port number for the IMAP server.
Example: --imap_port="143"
--imap_security
Specifies the security option you want to use. Use one of the following codes:
- 0 (no security)
- 1 (SSL)
- 2 (STARTTLS)
Example: --imap_security="1"
--imap_server_type
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"
--migrate_to_vault
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:
- Google Vault retention rules determine how long the message is retained in Vault.
- If you are migrating to Vault, you must have Gmail turned on in the Admin console. If Gmail is off, you will see 403 errors.
- Migration to Vault Former Employee (VFE) licensed users will fail because Gmail isn't turned on for these users.
--migration_usernames
Specifies the list of users for migration. If you use this argument, don't use --filename.
Example: --migration_usernames="user1,user2,user3"
--noenable_calendar_migration
Runs the migration without including calendar data.
--noenable_contact_migration
Runs the migration without including contact data.
--noenable_email_migration
Runs the migration without including email data.
--noenable_error_reports
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.
For more information about migration reports, go to the Reviewing migration reports section in the GWMME Admin Guide
.
--noenable_id_mapping
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.
--noenable_label_prefix
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.
--nouse_gui
Runs GWMME using the command line. Graphical user interface (GUI) mode is the default.
--nowait
Closes GWMME without you needing to press the Enterkey when the migration is run from the command line.
--num_threads
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"
--pst_base_folder
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:
- --source_server
- --exchange_profile_name
Example: --pst_base_folder="C:\pst"
--public_folder_mapping_file
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"
--retry_count
Specifies the number of retries if a temporary failure occurs, such as a busy server timeout. The default is 10.
Example: --retry_count="5"
--run_diagnostics
Runs the exhaustive pre-migration diagnostics, which validates server connectivity, authentication, access to accounts, and the entire user list.
--service_account_json_path
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"
--source_server
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"
--strip_user_labels
Specifies that messages are migrated without labels.
--translate_conflicting_events
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.
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.

