Sitecore DevOps: Serialization, the CLI and CI/CD for XM Cloud
Templates, renderings, and settings are stored as items in the Sitecore database. To manage them like code, you serialize them to files and commit them to Git. Sitecore Content Serialization (SCS) and the Sitecore CLI handle this.
Sitecore CLI
dotnet tool restore
dotnet sitecore login --authority https://auth.sitecorecloud.io --cm https://your-cm-instance
dotnet sitecore ser pull # items from Sitecore → files
dotnet sitecore ser push # files → Sitecore
Modules
Define what to serialize in *.module.json files:
{
"namespace": "Project.Site",
"items": {
"includes": [
{ "name": "templates", "path": "/sitecore/templates/Project/Site" },
{ "name": "renderings", "path": "/sitecore/layout/Renderings/Project/Site" }
]
}
}
Organise modules following Helix layers: Foundation, Feature, Project.
What to Serialize
- ✅ Templates, renderings, placeholders, settings, base content structure
- ❌ Editor-created content (it lives in the CMS, not Git)
- Use
allowedPushOperationslikeCreateOnlyfor items editors may change after creation
XM Cloud Deploy
XM Cloud Deploy connects to your Git repository and:
- Builds the CM solution
- Deploys to an environment (dev, staging, prod)
- Pushes serialized items
The Next.js rendering host is typically deployed separately to Vercel or Netlify.
A Typical Pipeline
- Developer creates a branch, changes templates locally, runs
ser pull - Pull request with code + serialized YAML
- Review and merge
- Deploy to dev → test → promote to staging → production
Tips
- Run
ser validatein CI to catch broken item trees - Keep environments in sync — avoid manual template changes in production
- Document which modules each team owns
If a template change isn't in Git, it doesn't exist. Serialization makes Sitecore changes reviewable and repeatable.