Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

As our platforms continue to scale internationally, demand for sanity data migrations has increased and has put more pressure on the engineering side as this was previously a technical task.

This tool grants the following benefits:

  1. Brand/region content teams are now able to create, test, and push their own data within Sanity.

  2. Automatically pulls in all references documents and assets preventing failed data migrations due to missing children references.

  3. More tactical than the current implementation wherein we need to move documents by type - meaning if we want to move a single offer, we currently need to move all offer documents and all possible child reference document types.

  4. Time to move data is reduced tremendously. To move one static page to production or QA, it now takes 10 seconds, where it used to take up to 20 mins (depending on dataset size).

Content Managers

For each brand/region, there is one designated β€œowner” who is responsible for migrating sanity data.

Burger King

Primary Owner

Secondary Owner

Region

Pita, Eli (Deactivated)

Maria Pedraza

US πŸ‡ΊπŸ‡Έ

Nicholas Hansen

CA πŸ‡¨πŸ‡¦

Carrington, Maria

CH πŸ‡¨πŸ‡­

Carrington, Maria

DE πŸ‡©πŸ‡ͺ

Carrington, Maria

ZA πŸ‡ΏπŸ‡¦

Carrington, Maria

GB πŸ‡¬πŸ‡§

Popeyes

Primary Owner

Secondary Owner

Region

Pita, Eli (Deactivated)

Kelly, Cassidy

US πŸ‡ΊπŸ‡Έ

kmckenna (Deactivated)

TBD

CA πŸ‡¨πŸ‡¦

Carrington, Maria

TBD

CH πŸ‡¨πŸ‡­

Tim Hortons

Primary Owner

Secondary Owner

Region

Franzon, Sofia (Deactivated)

TBD

US πŸ‡ΊπŸ‡Έ

Kanishk Singh (Deactivated)

Arvind Babu Podichetti

CA πŸ‡¨πŸ‡¦

Ground Rules

  1. You need a write token in order to use this tool. If you need one, request it from Posk, Mitchell (Deactivated) in the #sanity-migrations-owners slack channel (save it locally on your computer so you can re-use it). DO NOT SHARE THIS TOKEN.

  2. There should be one primary point of contact that is in charge of migrations for each brand/region, and one additional fallback migration owner in case the primary owner is out of office.

  3. Migrate data first to QA, validate the changes there, then move it from staging to production (the tool will only let you migrate from staging as staging is the source of truth).

Using the Document Action

Content creators are already accustomed to using document actions such as Publish or Delete. The document action works in a similar fashion to these actions:

Paste in your token…

Select destination dataset (always move QA first and validate before moving to production)…

Scroll down and click the migrate button, and wait for the migration to finish. Do not close this window!

When the migration is complete you will see a success message, if it errors, please reach out to Posk, Mitchell (Deactivated) in the #sanity-data-migration-owners slack channel.

Using the Tool

The Migration tool allows you to migrate multiple documents using a GROQ query, as opposed to only moving the currently viewed document (both tools also move children references). In terms of functionality, the actual migration tool works the same as the document action.

If you are unfamiliar with GROQ queries, you can see some of the most used patterns here.

Future Improvements

  • Add custom permissions so that even if a user has a write token, they will only be allowed to migrate data in their region.

  • No labels