You use a Google service account to connect to your target Google Workspace domain. You set up the target connection in the Google Workspace Migrate platform.
Before you begin
- You don't have to create a new service account. You can use the service account that you set up earlier. Follow the steps below if you want to create a new service account.
- You can create the new service account in a different Google Cloud project. If you do, first enable the APIs in the new project. Go to Step 1: Use Google Cloud to turn on APIs.
Steps to set up a target connection
Step 1: Create the service account (Optional)Before you begin: Use a Google Cloud project belonging to either the source or target environment, depending on how you want to manage your API usage and quotas. You can create the new service account in a different Google Cloud project. If you do, first enable the APIs in the new project. For details, go to Step 1: Use Google Cloud to turn on APIs.
- In Google Cloud, click IAM & AdminService Accounts. You might have to click Menu first.
- Click Create Service Account.
- For Service account name, enter a name.
The service account ID is completed automatically.
- (Optional) To add your own description to the service account, click Service account description and enter a description.
- Click Create and Continue.
- Service account and user permissions are not required for Google Workspace Migrate.
Click Done to skip these steps.
- Select the email address of the service account that you created.
- At the top, click KeysAdd KeyCreate new key.
- Make sure the key type is set to JSON and click Create.
You'll get a message that the service account JSON key file has been created and downloaded to your computer. Make a note of the name of this file because you’ll need it later.
- Click Close.
What happens next?
It can take up to 24 hours to create service accounts. If you lose the name of the key file, repeat these steps to create a new one.
Next, authorize the service account in the Google Admin console. You must complete this step even if you are reusing a service account.
-
Sign in to your Google Admin console.
Sign in using an account with super administrator privileges (does not end in @gmail.com).
-
In the Admin console, go to Menu SecurityAccess and data controlAPI controlsManage Domain Wide Delegation.
You must be signed in as a super administrator for this task. -
Click Add new and enter your service account client ID.
You can find the ID (also known as the Unique ID) in the JSON file that you downloaded when you created the service account or in Google Cloud (click IAM & AdminService accountsthe name of your service account).
- For OAuth scopes, copy and paste the following scopes:
https://apps-apis.google.com/a/feeds/emailsettings/2.0/,
https://www.googleapis.com/auth/contacts,
https://www.googleapis.com/auth/admin.directory.group,
https://www.googleapis.com/auth/admin.directory.group.member,
https://www.googleapis.com/auth/admin.directory.orgunit,
https://www.googleapis.com/auth/admin.directory.resource.calendar,
https://www.googleapis.com/auth/admin.directory.user,
https://www.googleapis.com/auth/apps.groups.migration,
https://www.googleapis.com/auth/apps.groups.settings,
https://www.googleapis.com/auth/calendar,
https://www.googleapis.com/auth/drive,
https://www.googleapis.com/auth/drive.appdata,
https://www.googleapis.com/auth/drive.file,
https://www.googleapis.com/auth/gmail.modify,
https://www.googleapis.com/auth/migrate.deployment.interop,
https://www.googleapis.com/auth/tasks,
https://www.googleapis.com/auth/userinfo.email,
https://sites.google.com/feeds,
https://www.googleapis.com/auth/gmail.settings.basic,
https://www.googleapis.com/auth/gmail.settings.sharing,
https://www.googleapis.com/auth/admin.directory.customer.readonly,
https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly - Click Authorize.
-
Point to the new client ID, click View details, and make sure that every scope is listed.
If a scope is not listed, click Edit, enter the missing scope, and click Authorize. You can't edit the client ID.
-
Go back to Google Cloud and click Save.
Troubleshoot
You might see the following error: Client is not authorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.
To troubleshoot:
- Repeat step 2 (Authorize the service account) above.
- Make sure you're using the correct client ID. Open the JSON file in a text editor to verify the client IDs match.
- If you still see the error, you might need to wait for the authorization process to finish. It usually takes a few minutes, but can take up to 24 hours.
- In the Google Workspace Migrate platform, click NewConnection.
- Enter a connection name.
- Under Type, select Google Workspace.
- Under Admin email, enter the email address of a super administrator for your target Google Workspace domain.
- Under Account, click Add new account.
- Under Service certificate, click Upload file, navigate to the downloaded JSON private key, and click Open. Or, drag the JSON file to the box.
- Click Create.