Gmail Migration Guide
Upgrading to 1.0.0
Only run Refresh stream and remove records if step 3 below tells you to. It deletes the existing destination rows before re-syncing, and Gmail can only return messages that still exist in the mailbox and are allowed by the connection's start date and spam/trash settings. Messages that were deleted, trashed or marked as spam since the original sync don't come back. Back up the affected tables before removing records if you need that data.
Version 1.0.0 declares the count and size fields of four streams as integers, and gives the profile stream a primary key. The values themselves don't change: Gmail documents these fields as int32 integers, and the connector already emitted whole numbers. Only the declared type changes, so typed destinations change the matching columns from a decimal or float type to an integer type.
What changes
The profile stream now uses emailAddress as its primary key. The following fields change from number to integer; they stay nullable:
profile:messagesTotal,threadsTotallabels_details:messagesTotal,messagesUnread,threadsTotal,threadsUnreadmessages_details:sizeEstimate,payload.body.size,payload.parts[].body.size,payload.parts[].parts[].body.size, andpayload.parts[].parts[].parts[].body.sizethreads_details:messages[].sizeEstimate,messages[].payload.body.size,messages[].payload.parts[].body.size,messages[].payload.parts[].parts[].body.size, andmessages[].payload.parts[].parts[].parts[].body.size
Why
The Gmail API documents these fields as int32 integers in its users.getProfile, users.labels and users.messages references. The profile endpoint returns one record for the authenticated mailbox, and emailAddress identifies that record, so you can now select a deduplicated sync mode for profile.
Who is affected
Connections that sync at least one of profile, labels_details, messages_details or threads_details. Connections that sync only drafts, labels, messages or threads aren't affected and need no action.
Among affected connections:
- Destinations that type their columns (BigQuery, Snowflake, Postgres, Redshift, MSSQL, ClickHouse and similar) change
messagesTotal,messagesUnread,threadsTotal,threadsUnreadandsizeEstimatefrom a decimal or float column to an integer column. The nestedpayloadandmessagesobjects are stored as JSON, so theirsizefields don't change a column type. Most of these destinations convert the existing column in place on the next sync. - S3 Data Lake (Iceberg) types nested fields too, and can't convert a double column to a long column in place. All four streams in an Append or Append + Deduped mode fail with
Schema evolution for column "..." between double and long is not alloweduntil you refresh them; see step 3. Refresh stream and remove records recreates the table with the new column types. - Object storage and file destinations that write JSON or CSV aren't affected: the values are written the same way as before.
profilein Full Refresh | Append keeps one row per sync, as before. Connections that set their own primary key forprofilenow useemailAddress.
Upgrade steps
- Upgrade the Gmail source to version 1.0.0.
- Refresh the source schema for each affected connection and review the detected changes before saving.
- Run a sync. Most destinations convert the columns automatically and no further action is needed. If the sync fails with a schema-evolution error, for example on S3 Data Lake in an Append or Append + Deduped mode, refresh only that stream with Refresh stream → Refresh stream and remove records. Read the warning at the top of this guide first: a
messages_detailsre-sync reads every message from your start date again, onemessages.getcall per message, so large mailboxes take a long time and messages deleted from the mailbox don't come back. Streams in Full Refresh | Overwrite are rebuilt by every sync and never need a separate refresh. - Update downstream queries, models and exports that depend on the changed columns or on the
profilekey.
Update downstream queries
On destinations that type their columns, these seven columns become integer columns (for example INT64 in BigQuery, NUMBER(38,0) in Snowflake, BIGINT in Postgres): profile.messagesTotal, profile.threadsTotal, labels_details.messagesTotal, labels_details.messagesUnread, labels_details.threadsTotal, labels_details.threadsUnread and messages_details.sizeEstimate. Check:
- Divisions between two of these columns. In Postgres,
messagesUnread / messagesTotalon integer columns truncates to0; cast one side to a decimal type first. - Casts and type checks that expected a decimal or float column, such as
CAST(messagesTotal AS INTEGER), which are no longer needed. - Models or dashboards that deduplicate
profileon a key of their own; the stream's key is nowemailAddress.
For more information about refresh options, see Refresh data.
Connector upgrade guide
Review the following information to prepare for and execute your upgrade.
Review the changelog
Before updating a connector, review the changelog to understand the changes and their potential impact on your existing connections. Find the changelog for any connector by navigating to the bottom of the documentation for that connector. Major version releases also include a migration guide.
Plan for major updates
Major updates may require you to adjust connection settings or even make changes to your data pipelines. Allocate enough time and resources for this. Use the migration guide to ensure your transition process goes smoothly.
Airbyte provides tooling that guarantees safe connector version bumps and enforces automated version bumps for minor and patch updates. You always need to manually update for major version bumps.
Self-managed plans: pin a specific version if you can't update
If you're unable to upgrade to the new version of a connector, you can pin that connector to a specific version.
-
In the navigation bar:
-
If you're on the Self-Managed Enterprise plan, click Organization settings > Sources/Destinations.
-
If you're on any other plan, click Workspace settings > Sources/Destinations.
-
-
Edit the entry for the connector you want to pin.
-
Set the Default Version to the version you want to use.
Self-managed plans: update the local connector image
If you self-manage Airbyte, you must manually update the connector image in your local registry before proceeding with the migration. Follow the steps below.
-
In the navigation bar:
-
If you're on the Self-Managed Enterprise plan, click Organization settings > Sources/Destinations.
-
If you're on any other plan, click Workspace settings > Sources/Destinations.
-
-
Find the connector you want to update in the list of connectors.
noteAirbyte lists two versions, the current in-use version and the latest version available.
-
Click Change to update your OSS version to the latest available version.
Update the connector version
Update each instance of the connector separately. If you have multiple instances of a connector, updating one doesn't affect the others.
-
In the navigation bar:
-
If you're on the Self-Managed Enterprise plan, click Organization settings > Sources/Destinations.
-
If you're on any other plan, click Workspace settings > Sources/Destinations.
-
-
Select the instance of the connector you wish to upgrade.
-
Select Upgrade.
-
Follow the prompt to confirm you are ready to upgrade to the new version.
Clear data from affected streams
After upgrading a connector with a breaking change, you must refresh affected schemas and clear your data.
-
In the nav bar, click Connections.
-
Find the connection affected by the upgrade.
-
Click the Schema tab.
-
Click Refresh source schema (looks like ). When Airbyte finishes, it shows you any detected schema changes.
-
Click OK.
-
Click Save changes
-
Clear the data for the streams affected by this upgrade.
Once the clear is complete, you can begin syncing your data again as usual.