Sitecore DevOps: Serialization, the CLI and CI/CD for XM Cloud

Sitecore items belong in source control

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 allowedPushOperations like CreateOnly for items editors may change after creation

XM Cloud Deploy

XM Cloud Deploy connects to your Git repository and:

  1. Builds the CM solution
  2. Deploys to an environment (dev, staging, prod)
  3. Pushes serialized items

The Next.js rendering host is typically deployed separately to Vercel or Netlify.

A Typical Pipeline

  1. Developer creates a branch, changes templates locally, runs ser pull
  2. Pull request with code + serialized YAML
  3. Review and merge
  4. Deploy to dev → test → promote to staging → production

Tips

  • Run ser validate in 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.

Arivanandhan Chitheshwaran