Uniform Siphon - Contentful CMS Migration Walkthrough
This guide walks you through the complete process of migrating content and assets from Contentful CMS to the Uniform platform using Uniform Siphon tools.
Table of Contents#
- Prerequisites
- Installation and Setup
- Phase 1: Download Contentful Data
- Phase 2: Migration to Uniform
- Assessment and Validation
- Advanced Topics
Overview#
The migration process happens in 4 logical steps:
- Source content and media is downloaded from Conetntful with
contentful-cli
to a Windows machine - Content are processed with
Siphon.Migration.Contentful.exe
and Uniform files are produced - Media files are pushed to Uniform project using
Siphon.Migration.Contentful.exe
- Uniform files are pushed to Uniform using Uniform CLI (
@uniformdev/cli
)
Prerequisites#
System Requirements#
- Windows machine
- Direct HTTP access to Contentful space and Uniform project
Recommendations#
- Use PowerShell for running command-line tools
- Ensure sufficient disk space for downloaded content
Installation and Setup#
1. Extract Siphon Tools#
Extract all siphon-*-XXXXXXX-X.zip
distribution packages provided by Uniform to a local folder:
2. Prepare work directory#
Create a work directory for all files will be downloaded and processed, for example: C:\migration\
.
Open a new PowerShell session and navigate there:
4. Use environment variables#
It is recommended to create .env
file in the work directory and use environment variables instead of command-line arguments.
Environment variables can be used instead of command-line arguments:
SIPHON_{PARAMETER}
works with all Siphon executables and all commands that have particular parameter,SIPHON_{COMMAND}_{PARAMETER}
: works only with{COMMAND}
that have particular parameter withinSiphon.Migration.Contentful.exe
.
For example:
Siphon reads .env
files from:
- Current working directory
- Siphon executable directory
5. Configure Logging#
Set up PowerShell logging for the entire session:
Log Levels#
All commands accept --logLevel
parameter with these values:
debug
- Includes all types (default)info
- Also includeswarn
anderror
warn
- Also includeserror
error
- Only error messages
Phase 1: Download Contentful Data#
1.1 Prepare a work directory#
Create a work directory for all files will be downloaded and processed, for example: C:\migration\contentful
.
Open a new PowerShell session and navigate there:
Step 1: Install Contentful CLI#
1.2 Download Content#
Download contentful content using the contentful-cli
.
Basic Command Structure#
The export produces a JSON file for content, plus assets folders with binary files.
Parameters#
Parameter | Description |
---|---|
--space-id | ID of Space with source data |
--environment-id | ID of Environment with source data, default: master . |
--management-token | Contentful management API token. |
--delivery-token | Contentful delivery API token - Required for published content migration, without this token the latest content from the space will be migrated. |
--download-assets | With this flags assets will also be downloaded. |
Phase 2: Migration to Uniform#
Migrate content entries and content types from Contentful to Uniform Content Entries. The process transforms the extracted data from Contentful and pushes it to the Uniform platform.
Pre-requisites:#
- Ensure that the download of Contentful data is complete.
- Prepare a Uniform Project and manually add all languages that were previously downloaded
- Set up a Uniform Content Data Source in your Uniform project
- Create an API Key with a
Developer
role
2.1 Migrate to Content#
Transform Contentful content types and entries into Uniform Content content types and entries.
Required Parameters#
Parameter | Description |
---|---|
--inputDir | Downloaded Contentful data folder |
--outputDir | Uniform content output folder |
Optional Parameters#
Parameter | Description |
---|---|
--dataSourceId | Uniform Content Data Source ID, for example: content |
--slugFieldId | Field name in the Contentful entry that will be used for the Uniform entry slug |
--languages | Limit to specific languages (e.g., en-US,da-DK ), empty value means migrate content in all registered languages (default: empty) |
2.2 Push Content Data#
Deploy content entries to Uniform platform.
2.3 Upload Assets#
Upload media assets to Uniform Asset Library.
Required Parameters#
Parameter | Description |
---|---|
--inputDir | Downloaded files folder |
--UNIFORM_API_KEY | Uniform API key |
--UNIFORM_PROJECT_ID | Uniform Project ID |
Optional Parameters#
Parameter | Description |
---|---|
--languages | Limit to specific languages (e.g., en-US,da-DK ), empty value means migrate content in all registered languages (default: empty) |
--skipUnusedMedia | Upload only media directly referenced by previously-downloaded content (default: false ) |
--threads | Upload threads (default: 4) |
Assessment and Validation#
Analyzing Migration Results#
To assess migration quality, analyze the log files:
Re-run with warnings only:
C:\siphon\Siphon.Migration.Contentful.exe uniform-content [params] --logLevel Warn | Tee-Object .\assessment.txtReview in text editor:
- Open
assessment.txt
in Notepad++ - Menu → Edit → Line Operations → Remove duplicate lines
- Review each unique warning/error
- Open
Common issues to check:
- Missing field mappings
- Unsupported field types
- Reference resolution failures
- Language-specific problems
Advanced Topics#
Transformation Commands#
Siphon includes various transformation commands for post-migration cleanup and optimization.
Replace Image URL Fields#
Convert Contentful image URLs to Uniform asset references:
Replace Data Types#
Update data source IDs in Uniform resources:
Find Orphaned Data Types#
Identify unused data type definitions:
Calculate Migration Scope#
Analyze usage of specific data sources:
Convert Entries to Components#
Transform entries into reusable components:
For additional support, contact Uniform support with detailed log files and error messages.