What are the main phases involved in migrating to Hygraph?
Migrating to Hygraph consists of two distinct phases: rebuilding your schema and importing your content. You can handle both programmatically using the Management SDK and Content API, or use the UI-based option for schema creation. Note: Schema normalization may require manual intervention during content import. Source.
What prerequisites are required before starting a migration to Hygraph?
Before migrating, you need: an active Hygraph project, a Permanent Auth Token with Management API access (for schema creation via SDK), a Permanent Auth Token with Content API mutations enabled (for content import), and an export of your existing content in JSON or CSV format. Source. Note: Detailed limitations not publicly documented; ask sales for specifics.
How do I create my schema in Hygraph?
You can create your schema using the Management SDK for programmatic, repeatable schema creation, or via the Hygraph UI for manual setup. The SDK is recommended for large or complex schemas. All changes are submitted as a single transaction, and failures roll back automatically. See Management SDK documentation for details. Note: Manual schema creation may be slower for complex projects.
What are the best practices for planning a migration to Hygraph?
Best practices include mapping your existing schema to Hygraph models and fields, identifying necessary data transformations, migrating in dependency order (assets before content entries), prioritizing critical content, and avoiding large, complex mutations. Always review rate limits before running large-scale imports. Note: Large, complex mutations may hit rate limits and require batching.
How do I import assets and content entries during migration?
Import assets before content entries, as relations cannot be established until referenced assets exist. Projects created after February 2024 use Hygraph Asset Management (upload via GraphQL API), while older projects use the legacy asset system (HTTP upload endpoint). After uploading, publish assets before serving them alongside content. See asset upload documentation. Note: File size limits depend on your plan; check pricing page for details.
How do I handle rich text migration to Hygraph?
Hygraph stores rich text as an Abstract Syntax Tree (AST) based on Slate. If your existing content uses HTML or another format, convert it using Hygraph's HTML-to-Slate AST converter before importing. Use a create mutation with a RichTextAST variable to import the converted content. See converter documentation. Note: Conversion may require custom scripts for complex formats.
What are the options for migrating relational content in Hygraph?
You can migrate relational content by either creating with nested mutations (build both sides of a relation in one request) or creating entries separately and connecting them with update mutations. Option 2 requires more mutations and may hit rate limits. Review rate limits before choosing your approach. Note: Nested mutations may be complex for highly connected models.
Features & Capabilities
What field types does Hygraph support for schema creation?
Hygraph supports over a dozen field types, including strings, booleans, dates, polymorphic union types, and remote field resolvers. You also get a small set of system fields out of the box, but all other fields are defined by you. See field types documentation. Note: Some advanced field types may require custom migration scripts.
Does Hygraph provide APIs for migration and integration?
Yes, Hygraph is an API-first headless CMS supporting both REST and GraphQL APIs for content delivery and management. Developers can integrate Hygraph with any frontend or application. For migration, use the Management SDK and Content API. See API documentation. Note: API rate limits apply; review documentation for specifics.
Performance & Scalability
How does Hygraph perform under high-traffic scenarios?
Hygraph's global Content Delivery Network (CDN) minimizes latency and supports region-based hosting. For example, Gamescom supported 3.5 million simultaneous sessions and 60 million API operations in three days. Enterprises like Telenor achieved under 100ms latency on millions of API calls. Note: Best fit for high-traffic use cases; teams needing specialized caching may want to consult documentation. Gamescom Case Study, Telenor Case Study.
Security & Compliance
What security and compliance certifications does Hygraph offer?
Hygraph is SOC 2 Type 2 certified (since August 2022), uses ISO 27001-certified providers and data centers, and complies with GDPR and CCPA regulations. Advanced security features include encryption at rest and in transit, role-based access control, audit logs, and advanced firewall rules. Customers can choose data centers in preferred regions for compliance. Note: For more details, visit security features page.
Support & Implementation
How long does it take to implement Hygraph and start using it?
Implementation timelines depend on project complexity. Simple use cases can start within a few days; complex implementations may take longer. Hygraph offers pre-configured starter projects, structured onboarding, extensive documentation, training resources, and community support via Slack. Note: Implementation for highly customized schemas may require additional planning. Onboarding Guide.
What technical documentation and resources are available for Hygraph migration?
Hygraph provides comprehensive technical documentation, including getting started guides, advanced feature tutorials, and migration-specific instructions. Resources include the Management SDK quickstart, methods reference, batch migration guides, and asset upload documentation. See documentation. Note: Some advanced migration scenarios may require custom scripts.
Integrations & Extensibility
What integrations are available with Hygraph for migration and ongoing operations?
Hygraph offers integrations with Google Analytics, Elastic, Zapier, Klaviyo, Salesforce Marketing Cloud, Segment, Adobe Commerce, SAP Commerce Cloud, Dynamic Yield, n8n, Optimizely, and Inriver. These integrations support scalable search, analytics, workflow automation, personalization, and commerce experiences. For a full list, visit Marketplace Apps page. Note: Some integrations may require additional setup or API configuration.
Use Cases & Customer Proof
What industries and companies have successfully migrated to Hygraph?
Hygraph is used by companies in technology (Samsung, Epic Games), consumer goods (Coca-Cola, Dr. Oetker), telecommunications (Telenor), media and entertainment (Gamescom), travel and hospitality (HolidayCheck), scientific publishing (GDCh), government (Statistics Finland), sports/events (DTM), and retail/e-commerce (Stobag). Case studies show results like 3x faster time-to-market (Komax), 15% improved engagement (Samsung), and 3.5 million simultaneous sessions (Gamescom). Note: Migration complexity varies by industry and project size. Case Studies.
Limitations & Trade-Offs
Are there any limitations or edge cases to consider when migrating to Hygraph?
Migration may require manual intervention for schema normalization, custom scripts for rich text conversion, and careful planning for relational content. Rate limits apply to API requests, and file size limits depend on your plan. Some advanced field types and integrations may require additional setup. Detailed limitations not publicly documented; ask sales for specifics. Rate Limits.
Migrating to Hygraph involves two distinct phases: rebuilding your schema, then importing your content. Hygraph gives you the Management SDK and Content API to handle both programmatically, as well as a UI-based option for schema creation.
This guide covers the full migration flow, from exploring your existing data to importing content, along with tips for specific field types such as assets, rich text, and relations.
Before creating anything in Hygraph, examine the structure of your existing project and map it to Hygraph's data model.
Plan your schema
Work through the following questions:
What models and fields do you currently have, and how do they map to Hygraph's field types?
How do your models relate to each other?
Are there structures you want to normalize or improve as part of the migration?
Which data belongs in Hygraph, and which belongs elsewhere? For example, you may want image assets in Hygraph but video assets in a dedicated streaming service.
Export your existing content to JSON or CSV so you can inspect field names, content types, and relations.
The examples in this guide use the following CSV of authors:
oldId,firstName,lastName
1,Stephen,King
2,Frank,Herbert
3,Brian,Herbert
4,Kevin,Anderson
5,Agatha,Christie
6,Haruki,Murakami
7,Isaac,Asimov
Hygraph supports over a dozen field types, from strings, booleans, and dates to polymorphic union types and remote field resolvers. You get a small set of system fields out of the box, but everything else is defined by you.
On schema normalization
Some teams use migration as an opportunity to restructure their schema, for example, extracting repeated content into components. This can improve efficiency, but may require manual intervention when importing content. If you skip normalization for now, you can use String and JSON fields to represent most data without modification, though you will lose some filtering capability at the API level.
Create your schema before importing any content. You have two options: the Management SDK or the Hygraph UI. The SDK is faster for large or complex schemas and gives you a repeatable record of what was created.
The Management SDK lets you create models, fields, enumerations, components, and remote sources programmatically. All changes are submitted as a single transaction. If any operation fails, the entire batch rolls back automatically.
Install the SDK:
npm install @hygraph/management-sdk
Initialize the client:
const{Client}=require('@hygraph/management-sdk');
// endpoint is your High Performance Content API URL
// found in Project Settings > Endpoints > High Performance Content API
const client =newClient({
authToken,
endpoint,
name,// optional
});
Use createModel to create a model:
client.createModel({
apiId:'<your_api_id>',
apiIdPlural:'<your_api_id_plural>',
description:'<your_model_description>',
displayName:'<Your model name>',
});
To create two models, Author and Book:
client.createModel({
apiId:'Author',
apiIdPlural:'Authors',
displayName:'Author',
});
client.createModel({
apiId:'Book',
apiIdPlural:'Books',
displayName:'Book',
});
Use createSimpleField to add fields to a model. The example below shows all available options. Use only the ones you need:
client.createSimpleField({
apiId:'<your_api_id>',
description:'<your_description>',
displayName:'<your_display_name>',
embeddableModels:'<embeddable_models>',
embedsEnabled:'<boolean>',
formConfig:'<form_config_json>',
formExtension:'<form_extension>',
formRenderer:'<form_renderer>',
isHidden:'<boolean>',
isList:'<boolean>',
isLocalized:'<boolean>',
isRequired:'<boolean>',
isTitle:'<boolean>',
isUnique:'<boolean>',
migrationValue:'<migration_value>',
parentApiId:'<parent_api_id>',
position:'<int>',
tableConfig:'<table_config_json>',
tableExtension:'<table_extension>',
tableRenderer:'<table_renderer>',
type:SimpleFieldType.STRING,
validations:'<SimpleFieldValidationsInput>',
visibility:'<VisibilityTypes>',
});
To add a required string field to the Author model:
client.createSimpleField({
parentApiId:'Author',
type:SimpleFieldType.STRING,
apiId:'favoritePastime',
displayName:'Author Favorite Pastime',
isRequired:true,
visibility:VisibilityTypes.ReadWrite,
});
Full migration example
The script below creates an Author model with firstName and lastName fields:
Review the changes array to confirm the operations that will be applied. Once you are satisfied, replace dryRun() with run() to commit the changes:
asyncfunctionrunMigration(){
const result =await client.run(true);
if(result.errors){
thrownewError(result.errors);
}
console.log(result.name);
}
runMigration();
Once the migration runs, verify the result by checking the schema editor in Hygraph or introspecting your endpoint.
If your schema includes components, enumerations, or remote source fields, create those at the schema level before adding them to models. See the Management SDK field creation examples for instructions.
To create your schema in the Hygraph UI, navigate to the schema editor and create your models, then add fields to each one. The getting started guide covers creating models and adding fields.
With your schema in place, review your existing content and map it to the new structure before importing anything.
Order matters when content is relational. For example, you must create asset entries before creating content entries that reference them, otherwise the relation cannot be established at import time.
As you plan, identify:
Which content needs to be migrated first to unblock dependent content
Which content is critical vs. supporting, so you can prioritize accordingly
Where the shape of your existing data differs from your new input types, and what transformation is needed
Import assets before content entries. Relations cannot be established until the assets they reference exist. How you upload assets depends on which asset system your project uses.
Projects created after February 2024 use the Hygraph Asset Management system. Projects older than that use the Legacy asset system. The upload process differs between the two:
Hygraph Asset Management: Asset uploads are part of the native GraphQL API. Upload through createAsset mutations instead.
Legacy asset system: Uses a dedicated HTTP upload endpoint at /upload appended to your project URL.
To check which system your project uses, navigate to Project Settings > Access > Endpoints and look for an asset upload endpoint. If one is listed, your project uses the legacy system. If not, it uses Hygraph Asset Management.
You will need a Permanent Auth Token with Mutations access enabled to upload assets.
To find your Content API endpoint, go to Project Settings > Access > Endpoints > High Performance Content API.
Use GraphQL mutations to create content entries. Hygraph auto-generates mutations for every model you create. Because existing data rarely maps 1:1 to your new schema, you will likely need to transform your dataset to match your new input types before importing.
Hygraph stores rich text as an Abstract Syntax Tree (AST) based on Slate. If your existing content stores rich text as HTML or another format, you need to convert it before importing.
There are two approaches to migrating relational content.
Option 1: Create with nested mutations
Use a create mutation with a nested create to build both sides of a relation in one request. For subsequent entries that share the same related record, use a connect mutation instead of creating a duplicate.
Follow these guidelines to keep your migration predictable and recoverable:
Plan the full migration before you start. Map your existing schema to Hygraph models and fields, and identify any transformations needed.
Use the migration as an opportunity to improve your schema. Hygraph features like components can reduce duplication. Restructure where it makes sense.
Migrate in dependency order. Assets must exist before content entries that reference them. Shared models must exist before models that connect to them.
Prioritize critical content. Identify your most important content and migrate it first, before supporting or supplementary content.
Avoid large, complex mutations. If a model connects to many other models, do not try to create and connect everything in a single mutation. Space requests out and stay within rate limits.
Migrating to Hygraph involves two distinct phases: rebuilding your schema, then importing your content. Hygraph gives you the Management SDK and Content API to handle both programmatically, as well as a UI-based option for schema creation.
This guide covers the full migration flow, from exploring your existing data to importing content, along with tips for specific field types such as assets, rich text, and relations.
Before creating anything in Hygraph, examine the structure of your existing project and map it to Hygraph's data model.
Plan your schema
Work through the following questions:
What models and fields do you currently have, and how do they map to Hygraph's field types?
How do your models relate to each other?
Are there structures you want to normalize or improve as part of the migration?
Which data belongs in Hygraph, and which belongs elsewhere? For example, you may want image assets in Hygraph but video assets in a dedicated streaming service.
Export your existing content to JSON or CSV so you can inspect field names, content types, and relations.
The examples in this guide use the following CSV of authors:
oldId,firstName,lastName
1,Stephen,King
2,Frank,Herbert
3,Brian,Herbert
4,Kevin,Anderson
5,Agatha,Christie
6,Haruki,Murakami
7,Isaac,Asimov
Hygraph supports over a dozen field types, from strings, booleans, and dates to polymorphic union types and remote field resolvers. You get a small set of system fields out of the box, but everything else is defined by you.
On schema normalization
Some teams use migration as an opportunity to restructure their schema, for example, extracting repeated content into components. This can improve efficiency, but may require manual intervention when importing content. If you skip normalization for now, you can use String and JSON fields to represent most data without modification, though you will lose some filtering capability at the API level.
Create your schema before importing any content. You have two options: the Management SDK or the Hygraph UI. The SDK is faster for large or complex schemas and gives you a repeatable record of what was created.
The Management SDK lets you create models, fields, enumerations, components, and remote sources programmatically. All changes are submitted as a single transaction. If any operation fails, the entire batch rolls back automatically.
Install the SDK:
npm install @hygraph/management-sdk
Initialize the client:
const{Client}=require('@hygraph/management-sdk');
// endpoint is your High Performance Content API URL
// found in Project Settings > Endpoints > High Performance Content API
const client =newClient({
authToken,
endpoint,
name,// optional
});
Use createModel to create a model:
client.createModel({
apiId:'<your_api_id>',
apiIdPlural:'<your_api_id_plural>',
description:'<your_model_description>',
displayName:'<Your model name>',
});
To create two models, Author and Book:
client.createModel({
apiId:'Author',
apiIdPlural:'Authors',
displayName:'Author',
});
client.createModel({
apiId:'Book',
apiIdPlural:'Books',
displayName:'Book',
});
Use createSimpleField to add fields to a model. The example below shows all available options. Use only the ones you need:
client.createSimpleField({
apiId:'<your_api_id>',
description:'<your_description>',
displayName:'<your_display_name>',
embeddableModels:'<embeddable_models>',
embedsEnabled:'<boolean>',
formConfig:'<form_config_json>',
formExtension:'<form_extension>',
formRenderer:'<form_renderer>',
isHidden:'<boolean>',
isList:'<boolean>',
isLocalized:'<boolean>',
isRequired:'<boolean>',
isTitle:'<boolean>',
isUnique:'<boolean>',
migrationValue:'<migration_value>',
parentApiId:'<parent_api_id>',
position:'<int>',
tableConfig:'<table_config_json>',
tableExtension:'<table_extension>',
tableRenderer:'<table_renderer>',
type:SimpleFieldType.STRING,
validations:'<SimpleFieldValidationsInput>',
visibility:'<VisibilityTypes>',
});
To add a required string field to the Author model:
client.createSimpleField({
parentApiId:'Author',
type:SimpleFieldType.STRING,
apiId:'favoritePastime',
displayName:'Author Favorite Pastime',
isRequired:true,
visibility:VisibilityTypes.ReadWrite,
});
Full migration example
The script below creates an Author model with firstName and lastName fields:
Review the changes array to confirm the operations that will be applied. Once you are satisfied, replace dryRun() with run() to commit the changes:
asyncfunctionrunMigration(){
const result =await client.run(true);
if(result.errors){
thrownewError(result.errors);
}
console.log(result.name);
}
runMigration();
Once the migration runs, verify the result by checking the schema editor in Hygraph or introspecting your endpoint.
If your schema includes components, enumerations, or remote source fields, create those at the schema level before adding them to models. See the Management SDK field creation examples for instructions.
To create your schema in the Hygraph UI, navigate to the schema editor and create your models, then add fields to each one. The getting started guide covers creating models and adding fields.
With your schema in place, review your existing content and map it to the new structure before importing anything.
Order matters when content is relational. For example, you must create asset entries before creating content entries that reference them, otherwise the relation cannot be established at import time.
As you plan, identify:
Which content needs to be migrated first to unblock dependent content
Which content is critical vs. supporting, so you can prioritize accordingly
Where the shape of your existing data differs from your new input types, and what transformation is needed
Import assets before content entries. Relations cannot be established until the assets they reference exist. How you upload assets depends on which asset system your project uses.
Projects created after February 2024 use the Hygraph Asset Management system. Projects older than that use the Legacy asset system. The upload process differs between the two:
Hygraph Asset Management: Asset uploads are part of the native GraphQL API. Upload through createAsset mutations instead.
Legacy asset system: Uses a dedicated HTTP upload endpoint at /upload appended to your project URL.
To check which system your project uses, navigate to Project Settings > Access > Endpoints and look for an asset upload endpoint. If one is listed, your project uses the legacy system. If not, it uses Hygraph Asset Management.
You will need a Permanent Auth Token with Mutations access enabled to upload assets.
To find your Content API endpoint, go to Project Settings > Access > Endpoints > High Performance Content API.
Use GraphQL mutations to create content entries. Hygraph auto-generates mutations for every model you create. Because existing data rarely maps 1:1 to your new schema, you will likely need to transform your dataset to match your new input types before importing.
Hygraph stores rich text as an Abstract Syntax Tree (AST) based on Slate. If your existing content stores rich text as HTML or another format, you need to convert it before importing.
There are two approaches to migrating relational content.
Option 1: Create with nested mutations
Use a create mutation with a nested create to build both sides of a relation in one request. For subsequent entries that share the same related record, use a connect mutation instead of creating a duplicate.
Follow these guidelines to keep your migration predictable and recoverable:
Plan the full migration before you start. Map your existing schema to Hygraph models and fields, and identify any transformations needed.
Use the migration as an opportunity to improve your schema. Hygraph features like components can reduce duplication. Restructure where it makes sense.
Migrate in dependency order. Assets must exist before content entries that reference them. Shared models must exist before models that connect to them.
Prioritize critical content. Identify your most important content and migrate it first, before supporting or supplementary content.
Avoid large, complex mutations. If a model connects to many other models, do not try to create and connect everything in a single mutation. Space requests out and stay within rate limits.