How to Migrate From Hygraph (GraphCMS) to a Self-Hosted CMS

GraphQL to self-hosted — the full migration path

July 30, 2026 · 5 min read

Hygraph (formerly GraphCMS) is a GraphQL-native hosted headless CMS with strong content federation and a flexible schema. Teams building GraphQL-first apps like it. The reasons to leave are the usual SaaS ones: pricing that scales with API operations and content, your data living on Hygraph's platform, and no self-hosting option. Migrating off Hygraph takes a bit more care than most because it's GraphQL-first — but it's very doable. Here's the path to a self-hosted CMS without losing SEO.

TL;DR: Export Hygraph content via its GraphQL Content API, map its schema to posts and pages, import into a self-hosted CMS like UnfoldCMS, preserve slugs, set up 301 redirects, and repoint your front end. Key tradeoff: Hygraph is GraphQL, UnfoldCMS is REST — you'll rewrite your query layer.

Why migrate off Hygraph?

Clarify your driver first:

  • Usage-based cost. Hygraph pricing scales with API operations, content entries, and features. Growth raises the bill.
  • Hosted-only. Hygraph is SaaS. If self-hosting is a requirement, you must move.
  • Data ownership. Content lives on Hygraph's infrastructure. A self-hosted CMS puts it in your own database. See data ownership and your CMS.
  • Vendor dependency. Pricing and plan changes are outside your control.

If Hygraph's GraphQL federation is central to your architecture and cost is acceptable, staying makes sense. If ownership or cost drives you, read on.

What you're moving to

This guide targets UnfoldCMS, a self-hosted CMS on Laravel with a REST API at /api/v1/*, content in your own SQLite or MySQL database, and a one-time cost instead of a subscription. The steps apply to other self-hosted CMSes too.

The big caveat: Hygraph is GraphQL-native. UnfoldCMS is REST-only. Your entire front-end data layer — every GraphQL query and mutation — will be rewritten as REST calls. If keeping GraphQL is essential, look at Strapi or Directus instead, which both offer GraphQL. This guide assumes you're fine moving to REST.

Step 1 — Export via the GraphQL Content API

Query all your content through Hygraph's Content API. Write a query that pulls every entry of each model with all fields:

query {
  posts(first: 100) {
    id
    title
    slug
    content { html }
    publishedAt
    coverImage { url }
  }
}

Page through with first and skip (or cursor pagination) until you've captured everything. Hygraph's rich-text field can return html directly — request that so you skip a conversion step. Save the full JSON export, and download asset URLs to rehost.

Step 2 — Map the schema

Hygraph schemas are custom — you defined the models and fields. Map them to the target CMS:

Hygraph UnfoldCMS
Post model Post
Page model Page (content_type=page)
Rich-text field (html) Post body (HTML)
Asset (url) Media library (featured-image)
publishedAt posted_at
Category relation Post categories
slug Slug (preserve for SEO)

Since you can request rich text as HTML, the content itself maps cleanly. The work is aligning your custom models to posts/pages.

Step 3 — Import into the CMS

Write a migration script that reads the GraphQL export and creates a post or page per entry. UnfoldCMS stores body as HTML, so the html you exported drops straight in. Preserve slugs, set posted_at from publishedAt to keep chronology, and attach images to the media library.

Step 4 — Preserve SEO with redirects

If URLs change, set up 301 redirects from old to new paths — the key to holding rankings. UnfoldCMS ships a redirects system. Preserve slugs to minimize changes; audit every path regardless. See migrate a blog without losing SEO.

Step 5 — Rewrite the front-end data layer

This is the heaviest part, and it's specific to leaving a GraphQL CMS. Every GraphQL query in your front end becomes a REST call against UnfoldCMS's /api/v1/* endpoints:

// Before (Hygraph GraphQL)
const { posts } = await hygraphClient.request(POSTS_QUERY);

// After (UnfoldCMS REST)
const res = await fetch('https://cms.yoursite.com/api/v1/posts?per_page=20');
const { data: posts } = await res.json();

Go query by query. The upside: REST + fetch is simpler than a GraphQL client, so the rewritten layer usually ends up leaner.

Step 6 — Rebuild-on-publish

If you triggered rebuilds from Hygraph webhooks, replicate that with UnfoldCMS's outgoing HMAC-signed webhooks pointed at your deploy hook. Publishing fires the rebuild — same automation, self-hosted.

Migration checklist

  • [ ] Query all content via the GraphQL Content API (request rich text as HTML)
  • [ ] Download all assets
  • [ ] Map custom models to posts and pages
  • [ ] Import content, preserving slugs and publish dates
  • [ ] Attach images to the media library
  • [ ] Set up 301 redirects for any changed URLs
  • [ ] Rewrite front-end GraphQL queries as REST calls
  • [ ] Replicate rebuild webhooks
  • [ ] Verify sample pages before go-live

FAQ

Can I export my content from Hygraph? Yes. The GraphQL Content API returns every entry with all fields, and rich text can be requested as HTML. Assets are downloadable by URL. You get a full, exportable copy.

Will I lose SEO migrating off Hygraph? Not if you preserve slugs and set up 301 redirects for changed URLs. Same-slug migrations need minimal redirects.

Does UnfoldCMS support GraphQL like Hygraph? No — UnfoldCMS is REST-only. Moving to it means rewriting your GraphQL query layer as REST. If GraphQL is essential, choose Strapi or Directus instead.

How much work is the migration? Content export and import are straightforward, especially with rich text as HTML. The heavy part is rewriting the front-end data layer from GraphQL to REST — budget for that specifically.

Bottom line

Migrating off Hygraph means exporting via its GraphQL Content API, mapping your custom models to posts and pages, importing into a self-hosted CMS, and protecting SEO with redirects. The distinctive cost of leaving a GraphQL CMS is rewriting your front-end queries as REST — plan for it, or pick a GraphQL-capable target instead. In exchange you get data ownership and no subscription.

See UnfoldCMS in the demo or read the blog migration SEO guide.

Related: Migrate from Contentful · How to migrate a blog without losing SEO · CMS with GraphQL API

Free & Open Source

Own your CMS. No subscriptions.

Unfold CMS is free to download and self-host. Built on Laravel + React, full source code included.

Share this post:

Discussion

Comments (0)

Leave a Comment

Please log in to leave a comment.

Don't have an account? Register here

No comments yet. Be the first to share your thoughts!

Keep Reading

Related Posts

Back to all posts