Baack

Moving from Sanity to Baack

Browse the docs
No code

Sanity gives engineering teams a flexible, developer-built editing environment: content lives in Sanity's hosted Content Lake, and developers build the editing interface as a custom React application (Sanity Studio). That flexibility carries an operational tax. The Studio is another application your team has to bundle, deploy, and maintain, while editors work in abstract form fields rather than directly on the live page.

Migrating to Baack keeps your existing frontend intact. Your developers retain their framework (Astro, Next.js, Remix), styling, and CI/CD pipelines, swapping GROQ queries for Baack's client components. There is no Studio to maintain: editors work through the Baack console today, and directly on the live site with in-page editing (coming soon).

For early teams, we offer full support with the migration directly using our import tooling.

What we need to start

To map your schemas and run the migration:

  1. Your Studio schema definitions: The document and object schemas from your Studio code (typically in schemaTypes or schemas/).
  2. A dataset export or read token: Either an export tarball from the Sanity CLI, or a read-only (Viewer) API token so we can pull the dataset directly.
  3. A pilot page: A single route, such as /pricing or your homepage, to verify bindings before touching wider collections.

1. Map your document types

Sanity stores content as nested JSON documents, each with an _id and _type. Baack models content in a flat, sparse matrix addressed by name:sortOrder on an entity path.

In Sanity In Baack Notes
Singleton document (home, settings) Content entity Addressed by route path (e.g. /home)
Document collection (e.g. post) Entity list One entity per document, gathered into an ordered list
String, number, boolean, datetime Content items Native scalar items matching the field type
Portable Text (standard blocks) Markdown item Strips AST formatting overhead for clean, layout-free copy
Portable Text (custom objects) Template item Compound blocks mapped via Apache Velocity templates
Image asset field Image item Assets transferred to Baack's CDN with alt metadata preserved
Array of objects Positioned items Shared item names addressed by index (feature_title:0, feature_title:1)
Reference (_ref) Reference / Entity list Direct pointer to another entity or collection membership
Localized fields or documents Localized entities Distinct entities per locale (en-GB, de-DE) sharing the same path
Drafts (drafts.*) Excluded by default Published documents migrate first; draft history can be imported on request

Nested Sanity objects flatten cleanly. A hero object with title and subtitle fields becomes hero_title:0 and hero_subtitle:0. Repeated array items (like feature cards) share a name and increment by sortOrder (feature_title:0 through feature_title:2), making reordering straightforward for editors.

For compound components that couple copy with visual presentation, template items bundle the fields together without embedding HTML markup into your content model (see content entities and the content matrix).

2. Export your dataset

Sanity's CLI exports your dataset as a tarball containing an NDJSON document stream (data.ndjson) and asset files:

npx sanity@latest datasets export production production.tar.gz --no-drafts

Passing --no-drafts isolates published content. If you want historical revisions or in-progress drafts, omit the flag; draft IDs prefixed with drafts. can be imported into Baack's version history.

Alternatively, provide a Viewer API token and project ID. We can stream the dataset directly via Sanity's HTTP export endpoint (/data/export/<dataset>), which returns every document, including the asset documents that give each image's source.

3. Dry-run plan and import

Before modifying anything in Baack, our tooling generates a dry-run migration plan. This lists every entity path, content item, asset URL, and reference relationship that will be created, flagging unmapped object types or schema mismatches for sign-off.

The migration executes in two stages:

  1. Entities, items, and assets: Documents are created as draft entities. Portable Text is converted to markdown, with custom block objects mapped to template items. Images are fetched and stored as native image items (see creating image items).
  2. References and entity lists: Once all entities exist, relationships between documents are linked and collections are assembled into ordered lists.

Because imported content lands in an unpublished draft state, your team can inspect items in the console and test builds against the API before publishing anything to production.

4. Cut over page by page

There is no need for a high-risk replatforming release. Routes querying Baack and routes querying Sanity via GROQ can run alongside each other in the same frontend repository.

On your pilot page, replace the GROQ query with Baack's bridging components or directly access content items as props:

// Before: Sanity GROQ query fetch
const data = await sanityClient.fetch(`*[_type == "page" && slug.current == "pricing"][0]`);

// After: Baack component binding with fallback placeholder
import { ContentText } from "@baack-software/baack-ts-components/react";

<ContentText content={content.text("pricing_headline")} placeholder="Simple, predictable pricing" />

Components from @baack-software/baack-ts-components bind values directly by entity path and locale. Because each component accepts a fallback placeholder, your build will not fail if an item is temporarily unpopulated.

Once rendering is verified, connect a Baack webhook to your hosting provider (Vercel, Cloudflare, Netlify) to trigger automatic static builds when editors publish changes (see getting started with webhooks).

When all routes resolve through Baack, decommission the Studio deployment and archive the Sanity dataset.

Next steps

To review your Sanity schemas and plan the migration with our team, book a free stack audit. We will inspect your document models, scope the mapping, and set up your pilot page.

For a feature and pricing breakdown, see Baack vs Sanity.