The user wants a "Headless CMS Migration Playbook."
This is a comprehensive request that needs to cover three specific areas:
Schema Diffs: How to handle differences in content models between the old and new systems.
Content Backfills: The actual migration of data.
Editor Training: Preparing the humans who will use the new system.
Target Audience: Likely a Technical Lead, Solutions Architect, or Product Manager overseeing a migration project. The tone should be professional, structured, and actionable.
Key Phases of a CMS Migration:
Discovery & Planning (Pre-Migration): Understanding what we have vs. what we need.
Schema Mapping & Transformation: The technical "diff" work.
Migration Scripting & Execution: The "backfill" work.
Validation & QA: Making sure it worked.
Human Change Management: Training and rollout.
Drafting Section by Section:
Introduction: Briefly define the scope. A "playbook" implies a set of repeatable steps.
Phase 1: The Schema Audit & Diff (The "Diff" part of the prompt):
Challenge: Old CMS is rigid (e.g., WordPress) or messy. New CMS (e.g., Contentful, Strapi) is structured/API-first.
Tools: Mention migration CLI tools or custom scripts.
Phase 3: The "Diff" Management (Technical reconciliation):
What happens if the schema is fundamentally different?
Modular Blocks: Converting WYSIWYG blobs to structured components (this is huge in Headless). I need to emphasize parsing HTML/Markdown into JSON/Blocks.
Rich Text: Handling the specific format (e.g., Contentful Rich Text vs. HTML).
Phase 4: Editor Training & Change Management (The "Training" part of the prompt):
Challenge: UI change shock. Loss of "Preview" button (often).
Strategy: Don't just teach buttons; teach concepts.
Concept 1: Structured content (content as data).
Concept 2: Omnichannel thinking.
Tactics: Workshops, "Office Hours," Champions program.
Documentation: Custom guides, not generic docs.
Phase 5: The Cutover (Go-Live):
DNS switchover.
Cache warming.
Rollback plan (crucial).
Refining the Structure:
I will structure this as a literal "Playbook" with distinct "Plays" or "Phases."
Play 1: Audit & Modeling (The Schema Diff)
Play 2: The ETL Pipeline (The Backfill)
Play 3: Structuring the Unstructured (Handling the specific Diff challenge)
Play 4: Human Operations (Training)
Play 5: The Launch
Self-Correction/Review during drafting:
Initial thought: Focus heavily on code.
Correction: The prompt asks for "Editor Training" too, so the scope is broader than just engineering. I need to balance technical implementation with organizational change management.
Nuance: Headless often involves breaking up monolithic pages into components. I should specifically mention "Page Builder" migration (WYSIWYG to Blocks).
Formatting: Use bolding, lists, and clear headings to make it readable. A "Pre-flight checklist" is a nice touch.
Final Polish: Ensure terms like "Content Modeling," "References," "Localization," and "Preview" are used correctly in a Headless context.
Let's build the output based on this structure.
Migrating to a Headless CMS is rarely a simple "lift and shift" operation. It is a fundamental re-architecture of how your organization treats content—moving from "pages" to "data structures."
This playbook outlines the strategy for managing the technical debt of schema changes, the logistics of moving data, and the cultural shift required for editors.
The Headless CMS Migration Playbook
Phase 1: Schema Diffs & Modeling (The "Translation" Layer)
In a traditional CMS, the schema is often rigid (e.g., Title, Body, Image). In a Headless CMS, you must define the structure yourself. The challenge is mapping the old, often messy database to a new, strict schema.
1. The Audit & Mapping Matrix
Before writing code, create a Content Architecture Map.
Action: Export the database schema of the legacy CMS.
Deliverable: A spreadsheet mapping every legacy field to a new headless field type.
Legacy:Post Body (HTML Blob) →New:Rich Text (Structured JSON) or Markdown.
The schema in the new system will likely not be a 1:1 match.
The "Component" Shift: Legacy systems often use shortcodes or HTML embeds. Headless systems use Blocks or Components.
Play: You must write parsing scripts to convert legacy HTML shortcodes (e.g., [gallery id="123"]) into distinct component references in the new schema.
The "Fallback" Strategy: What happens if 10% of entries use a field that you decided to deprecate in the new schema?
Play: Do not delete data. Create a generic "Meta Data" JSON field in the new schema to catch orphaned data during migration. This allows the migration to succeed without failing validation, allowing editors to clean it up manually later.
3. Version Control the Schema
Treat your content model as code.
Play: Store your new content models (e.g., Contentful Migrations, Strapi schemas) in Git.
Benefit: You can spin up a staging environment with the exact schema version needed to test the migration script.
Phase 2: Content Backfills (The ETL Pipeline)
Moving content is an Extract, Transform, Load (ETL) process. Because headless CMSs are API-first, bulk writes can be slow and rate-limiting.
1. The "Asset First" Rule
Migrating text is easy; migrating files (images/PDFs) is hard.
The Trap: If you migrate text that links to legacy-cms.com/uploads/image.jpg, that link will eventually rot.
The Play:
Download all assets from the legacy system.
Upload them to the new Headless CMS (or a DAM like Cloudinary/AWS S3).
Capture the new Asset IDs.
During the content migration, replace legacy image URLs with the new Asset IDs.
2. Handling Legacy HTML (The "Sanitization" Step)
Most legacy content is a mess of inline styles, proprietary classes, and broken tags.
Play: Use a library like Cheerio.js or BeautifulSoup to scrape and clean.
Transformation Logic:
Strip inline CSS (e.g., style="color:red").
Convert <div> soup into semantic HTML.
Convert embedded YouTube URLs into a dedicated "Video Component" schema if possible.
3. The Staged Migration Approach
Do not attempt a "Big Bang" migration (moving everything at once).
Step 1: "Scaffold" Migration. Create entries with just titles, slugs, and dates. This establishes the URL structure immediately.
Step 2: "Shallow" Migration. Fill in main text content.
Tip: This requires a lookup dictionary. As you migrate an entry, save Legacy_ID→New_ID in a cache file (Redis or JSON) so you can link items together accurately.
Phase 3: Editor Training & Change Management
The biggest failure point in headless migrations is not the code; it is the editor experience. Editors lose the "What You See Is What You Get" (WYSIWYG) preview they have used for 15 years.
1. The "Lego" Metaphor
Editors must shift from thinking about "Pages" to thinking about "Data."
Training Script: "Stop asking 'Where does this text go on the page?' Start asking 'What fields is this data composed of?'"
Exercise: Have editors build a "Recipe" content type. Show them how filling out "Ingredients" as a list (rather than bold text in a body) allows the app developers to create a shopping list feature.
2. Solving the "Preview" Anxiety
The #1 complaint from editors in Headless CMS is: "I can't see what I'm doing."
The Fix: You must build a "Preview Deploy" environment.
Configure the CMS webhooks to trigger a build of a staging site instantly upon draft save.
Provide a "Preview Button" in the CMS sidebar that opens the draft content in a new tab.
Without this, adoption will fail.
3. The "Content Hygiene" Workshop
Use the migration as an excuse to clean house.
Policy: "If it hasn't been viewed in 2 years, it doesn't get migrated."
The Excel Audit: Give editors a spreadsheet of all legacy URLs. Ask them to mark rows as:
MIGRATE (Keep as is)
ARCHIVE (Keep but hide from search)
REDIRECT (Merge into a newer article)
DELETE (404)
Phase 4: The Execution Checklist
Pre-Migration (Dry Run)
Run the script on a local copy of the database.
Compare word counts between Legacy and New (to ensure truncation isn't happening).
Check for broken internal links (run a link checker against the staging site).
Verify URL slugs match exactly (for SEO preservation).
The "Switch" (Go-Live)
Read-Only Mode: Set Legacy CMS to read-only to prevent new content creation during the final sync.
DNS Switch: Update DNS to point to the new frontend.
Redirect Map: Upload the 301 redirect map (Old URL → New URL) to your CDN/Hosting provider (e.g., Vercel, Netlify).
Post-Migration Support
Office Hours: Developers sit with editors for the first week to fix small UI annoyances.
The "Bug Bash": Editors are incentivized to find content rendering bugs (e.g., "Who can find a broken image first?").