Skip to content
TurnIntoCMS

Execute a CMS to CMS Migration Without Content Loss

By Yash Garg · · 6 min read

A reliable CMS to CMS migration extracts data through programmatic APIs or CLI exports, normalizes text and relationships into structured JSON, moves media assets directly to your target storage, and maps 1-to-1 server-side 301 redirects. Attempting this through copy-paste or browser export interfaces leads to missing metadata, corrupt image paths, and broken page hierarchies. According to Google Search Central documentation, 301 and other permanent redirects do not cause a loss in PageRank.

If you are moving to a modern framework, evaluate whether you actually need an API-driven database layer or if you can store pages directly in code. For React and Next.js sites where clients only need to update copy, you can let clients edit Next.js sites without an external database by keeping the content inside your repository.

Step 1: Content inventory, schema mapping, and rich text normalization

Begin with a full audit of your source data before touching any command-line tools. Catalog every custom field, taxonomy, SEO title, meta description, and media asset across your existing records.

Never treat rich text as raw HTML strings. Legacy systems often store articles as monolithic blobs full of unclosed tags and hardcoded styling. Portable Text structures text into block elements and spans, as outlined in Sanity's content migration cheat sheet. If you pipe raw HTML directly into modern components, frontend layouts will break, and you lose the ability to query individual headings or render custom UI blocks.

Target schemas also enforce strict parity during migration runs. For example, Strapi's data transfer documentation shows that its transfer tooling requires exact schema matching between source and destination environments, failing if types or field attributes diverge. Modern web frameworks give you total control over how these models resolve: as noted in the Next.js project structure documentation, the framework remains unopinionated about internal organization, allowing private directories like `_lib` to house content validation schemas and transformation scripts safely outside public routing. Defining these interfaces carefully ensures that shared components can reuse content across multiple layouts without duplicating data.

Step 2: Export, ETL pipeline, and dependency-ordered import

Avoid web dashboard exports, which frequently time out or truncate nested records during large migrations. Instead, run exports through official CLI utilities and batch endpoints. For instance, Sanity handles dataset imports and exports using Newline Delimited JSON (NDJSON) archives via its CLI, as documented in Sanity's dataset export guide.

Your ETL (Extract, Transform, Load) pipeline must ingest content in dependency order:

  1. Assets and raw files (images, downloadable documents).
  2. Taxonomies, categories, and tags.
  3. Authors, contributors, and user profiles.
  4. Top-level pages and parent documents.
  5. Nested children, relational blog posts, and localized variants.

If you attempt to import an article before its referenced author ID exists in the target database, the migration will throw foreign key constraint errors or drop the relationship silently. Run validation before going live: the Sanity CLI release notes highlight commands like `sanity schema validate`, which identify problems with your schema-type definitions.

Take care to isolate draft documents from published records. Your extraction script must respect these flags so unfinished drafts do not go live automatically during cutover.

Step 3: Asset migration, URL rewrites, and media remapping

A frequent breakdown in CMS migrations occurs when media files are ignored. If you copy HTML bodies containing image links pointing to your legacy domain or local upload folder, everything renders fine during staging.

Your migration script must download every binary asset from the old system, upload it to the new media store or CDN, generate the new URL, and perform a find-and-replace across your structured copy.

Before pointing DNS records to your new setup, run through this pre-cutover checklist:

CheckFocus AreaVerification Rule
Media HostingCDN PathingZero image tags or Markdown embeds link to the old domain.
ReferencesForeign KeysAll author and taxonomy relations resolve to valid target IDs.
CanonicalsMeta TagsEvery canonical tag explicitly references the target production URL.
Draft StateVisibilityUnlisted, internal, or draft pages maintain unpublished status.
ValidationSchema TypesSchema validation tools report zero missing required attributes.

To manage the broader handoff steps across design, hosting, and client access, you can run through our website handoff checklist.

Step 4: SEO protection, 301 redirects, and cutover server headroom

Rankings drop after a migration when URL changes break internal link equity or external backlinks. If slug structures must change, create a 1-to-1 redirect mapping table. Point every legacy path straight to its exact new equivalent.

Do not redirect retired or irrelevant pages to your homepage. When content is genuinely deleted with no replacement, serve a standard 404 or 410 HTTP status code, as supported by Google's technical SEO guidelines.

Avoid common redirect pitfalls during migration planning:

  • Clean 1-to-1 redirect (preserves search signals): old post path points directly with a 301 to the new post path.
  • Redirect chain (avoid this): old post path redirects to an intermediate path before hitting the final destination.
  • Soft 404 error (avoid this): discontinued product or deleted post path points with a 301 to the home page.

Account for severe crawl spikes during cutover. Google Search Central documentation highlights that Googlebot must visit every URL on your old and new site at least once to consider a site move complete. Ensure your hosting infrastructure has sufficient server headroom to handle this traffic surge without throwing 5xx errors.

If you are comparing tools for this transition, you can explore our overview of a cms to cms migration tool to evaluate script options and data transformation workflows.

Alternative approach: Git-based workflows and in-code content

Not every project warrants migrating to a heavy database-backed headless CMS. When moving marketing sites, brochure pages, or portfolios, storing your content directly in code eliminates ongoing database maintenance.

Git-based CMS platforms bridge this gap. According to the Decap CMS documentation, content is stored in your Git repository alongside code for simpler versioning, using Git provider APIs to manage files. Similarly, the TinaCMS documentation shows that it commits content updates directly to Markdown, MDX, and JSON files inside the repository whenever an editor saves a change.

If you want a lightweight solution without defining new CMS collections or schemas, TurnIntoCMS provides a simple in-code alternative. It connects directly to your existing GitHub repository without requiring database provisioning, migration scripts, or framework lock-in. Editors click text, pictures, and links directly on a live site preview, and changes are written back as standard Git commits to the branch you specify.

TurnIntoCMS is free for one project, and each additional project costs $1 USD as a one-time payment. It fits sites built with Next.js, React, or Vite, but you should recognize its architectural limits: content must live in your JSX or imported data files, meaning it does not offer an external content delivery API or scheduled publishing workflows. For developers managing multiple client projects, you can review our guide on choosing a git-based CMS for freelancers to compare workflow overhead.

FAQ

How do I prevent SEO ranking drops during a CMS to CMS migration?

Keep your existing URL structure identical wherever possible. If paths must change, implement 1-to-1 server-side 301 redirects directly to the target URLs without chains, maintain matching metadata and canonical tags, and submit your updated XML sitemap in Google Search Console.

Should I migrate content using the CMS admin UI or the CLI?

Always use the platform's CLI or batch management APIs. Web dashboards regularly time out on large payloads, drop asset links, and fail to validate relational keys across complex collections.

How should deleted or pruned pages be handled during a CMS move?

If a legacy page has no direct equivalent on the new site, return an explicit 404 or 410 HTTP response code. Redirecting removed or irrelevant pages to your homepage causes Google to flag them as soft 404 errors, which harms your site's crawl efficiency.

How do I handle unlisted drafts so they do not publish accidentally?

Ensure your ETL extraction script inspects the source system's publish flags and document ID conventions. Modern platforms separate drafts using specific attributes or ID prefixes, which you must map directly to the destination system's draft schema to prevent unpublished content from appearing on the live site.

Sources

  1. Site Moves and Migrations (developers.google.com, checked December 1, 2026)
  2. Data transfer (docs.strapi.io, checked December 1, 2026)
  3. Content migration cheat sheet (sanity.io, checked December 1, 2026)
  4. Export a Sanity Dataset with the CLI (sanity.io, checked December 1, 2026)
  5. Technical SEO Techniques and Strategies (developers.google.com, checked December 1, 2026)
  6. New CLI Commands, Content Migration Tooling, Schema Validation, and Enhanced Localization & Validation Support (sanity.io, checked December 1, 2026)
  7. Decap CMS overview (decapcms.org, checked December 1, 2026)
  8. Get Started and learn about TinaCMS (tina.io, checked December 1, 2026)
  9. Project structure and organization (nextjs.org, checked December 1, 2026)

Related

More from the blog

Let your clients edit the site you coded

One website free. Then $1 each, paid once.

Get started free