Knowledge Base

Troubleshooting authentication problems when migrating from Google


You are unable to perform a migration from Gmail or Google Workspace (formerly G Suite) via the IMAP protocol. The following error message is displayed:

[AUTHENTICATIONFAILED] Invalid credentials (Failure)


Starting May 30, 2022, Google has discontinued the support for using third-party apps to access Google accounts by providing only username and password. To allow CodeTwo migration software to migrate mailboxes from Gmail / Google Workspace, enable 2-step verification for all Google accounts you intend to migrate and use app passwords instead of regular Google passwords.

Follow the steps below to be able to proceed with your migration:

  1. Sign in to your Google account ( and go to Security in the navigation menu on the left.
  2. In the How you sign in to Google section, click 2-Step Verification and next Get started. Complete the wizard to enable 2-step verification, so that its status looks as shown in Fig. 1.

2-step verification enabled in the Google account sign-in settings.
Fig. 1. 2-step verification enabled in the Google account sign-in settings.

  1. Now, click 2-Step Verification again, scroll down to the very bottom of the page, and click App passwords. Alternatively, you can use this direct link:
  2. Click Select app and choose Other (Custom name), as shown in Fig. 2.

App password setup.
Fig. 2. App password setup.

  1. Type in your custom app name (e.g. CodeTwo Office 365 Migration) and click GENERATE.

Providing the app name.
Fig. 3. Providing the app name.

  1. Your password (16-character code) appears in a new window. Copy the password so that it can be used when configuring the migration job, then select DONE.

Fig. 4. Generated app password.


The above steps need to be carried out for each migrated mailbox separately.

  1. When configuring your IMAP migration job, you need to upload a CSV file that includes information about your source mailboxes. The file needs to contain the generated app passwords instead of the standard Google account passwords, as shown in Fig. 5.

An example of a CSV file created in Excel containing the generated app password.
Fig. 5. An example of a CSV file created in Excel containing the generated app password.

Refer to the user’s manual to learn more about configuring a migration job in:

  1. Once you have completed the configuration wizard, start the migration job.
Was this information useful?