Managing migrations
The Groups Migration API manages the migration of shared emails from public folders and distribution lists to a group's discussion archive. The media upload feature allows the API to store group email messages in the cloud and make it available to the server. When managing a migration, it is important to note:
- The API is for the migration of shared emails to Google Groups. For information about migrating or syncing emails from a specific custom application to G Suite, see the administration help center.
- All group members who have access to the group's archive can view the migrated messages. But the emails are not delivered to individual group members. For specific information for custom application migration to G Suite, see the administration help center.
- For migration purposes, the API returns an error if a group is suspended, has not been created, or has read-only access. For more information about how to identify and fix these, see the Directory API, the Groups Settings API, and the administration help center.
- Before migrating an email message:
- Confirm that the target group exists and the group's email is accurate before migrating an email message to that group's archive.
- If the email's sender has the same domain as the target group, confirm the email sender exists before migrating the email message to the target group's archive.
- Before migration, the email message format must be in the RFC 822 standard definition. Use the
Content-type: message/rfc822
header. Confirm the email message'sTo:
,From:
, andDate:
fields are properly formed. The response is returned in the JSON data format. - The API supports parallel requests for email insertions into different group archives. But the API does not support parallel message insertions into the same group archive. The API project's maximum QPS is 10, and the maximum number of migration requests per day is 500,000.
- The API does not support data location policies requiring data to be stored in specific geographic or political boundaries for contractual reasons. Do not use the API if data location is required for your account.
Migrate an email message to Google Groups
To migrate an email message to a group's archive, use the following POST
HTTP request. Include the Authorization
header as described in Authorizing requests. The group email address
is the requested destination of the migrated email message.
POST https://www.googleapis.com/upload/groups/v1/groups/group email address/archive?uploadType=media
JSON request
This example migrates email messages to the samplegroup@googlegroups.com archive. The Content-Length
is limited to 25MB which includes the message's meta data, body, and any attachments:
POST https://www.googleapis.com/upload/groups/v1/groups/samplegroup@googlegroups.com/archive?uploadType=media Host: www.googleapis.com Content-Type: message/rfc822 Content-Length: number of bytes in the email Authorization: Auth token The email's meta data, body, and any attachments
This is an example email message in RFC 822 text format that was migrated into the archive of samplegroup@googlegroups.com. The NNNN@mail.samplegroup.com
is this example's Message-ID. The migrated email's sender is samplesender@example.com and the email is migrated to the archive of the samplegroup@googlegroups.com group:
Received: by 10.143.160.15 with HTTP; Mon, 16 Jul 2007 10:12:26 -0700 (PDT) Message-ID: <NNNN@mail.samplegroup.com> Date: Mon, 16 Jul 2007 10:12:26 -0700 From: "samplesender@example.com" To: "samplegroup@googlegroups.com" Subject: SUBJECT MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Delivered-To: samplegroup@samplegroup.com This is the body of the migrated email message.
JSON response
A successful response returns a 200
HTTP status code. Along with the status code, the response returns the migration status. For more information about responseCode
values, see the API Reference.
{ "kind": "groupsMigration#groups", "responseCode": "SUCCESS", }