Promote Code and Content Between Environments
Why promotion matters
Section titled “Why promotion matters”Code and content flow in opposite directions. Code moves forward from Integration to Preproduction to Production. Content often needs to move backward from Production to lower environments for realistic testing. Getting both flows right ensures your team tests against real data and deploys with confidence.
Promote code forward
Section titled “Promote code forward”Integration to Preproduction
Section titled “Integration to Preproduction”After validating a deployment in Integration:
- In the management portal, navigate to Deployments
- Find the successful Integration deployment you want to promote
- Click Deploy to Preproduction
- The platform deploys the same build package to Preproduction
- Monitor the deployment log for errors
- Verify the Preproduction site once deployment completes
Preproduction to Production
Section titled “Preproduction to Production”After stakeholder validation in Preproduction:
- Navigate to Deployments
- Find the Preproduction deployment to promote
- Click Deploy to Production
- Confirm the promotion — this affects the live site
- The platform executes a zero-downtime deployment
- Monitor the deployment log and health checks
- Verify the Production site
Promotion via CLI
Section titled “Promotion via CLI”# Promote the latest Integration deployment to Preproductionopti deploy promote --from Integration --to Preproduction
# Promote a specific deployment by IDopti deploy promote --deployment-id abc123 --to ProductionPromotion via API
Section titled “Promotion via API”curl -X POST \ "https://paasportal.episerver.net/api/v1.0/projects/{projectId}/deployments/{deploymentId}/promote" \ -H "Authorization: Bearer {apiKey}" \ -H "Content-Type: application/json" \ -d '{"targetEnvironment": "Preproduction"}'Synchronize content backward
Section titled “Synchronize content backward”Export Production database
Section titled “Export Production database”To get production content into a lower environment for testing:
- In the management portal, navigate to Databases
- Select Production
- Click Export to create a database backup
- Wait for the export to complete
Import to a lower environment
Section titled “Import to a lower environment”- Navigate to Databases
- Select the target environment (Integration or Preproduction)
- Click Import or Refresh from Production
- Select the exported backup
- Confirm — this replaces the target database entirely
- Wait for the import to complete
After importing production data:
- Update test-specific configuration (API keys, webhook URLs)
- Clear application caches
- Verify the application starts correctly with the imported data
- Notify your team that the environment data has been refreshed
Synchronize blob storage
Section titled “Synchronize blob storage”Media files are stored separately from the database. To synchronize:
Option A: Share blob storage (read-only)
Configure lower environments to read from the production blob storage endpoint. Media appears without copying files, but lower environments cannot modify production media.
ConnectionStrings__EPiServerAzureBlobs = DefaultEndpointsProtocol=https;AccountName=prodaccount;...Option B: Copy blob storage
Use the management portal to copy media files from Production to a lower environment. This creates an independent copy that can be modified without affecting Production.
Content promotion (moving content forward)
Section titled “Content promotion (moving content forward)”Moving content from a lower environment to Production is less common but sometimes needed for pre-built content packages.
Content export/import
Section titled “Content export/import”- In the CMS editor on the source environment, select the content tree node to export
- Go to Admin > Export/Import Data
- Export the content package (.episerverdata file)
- In the target environment, go to Admin > Export/Import Data
- Import the content package
- Review and publish the imported content
Caution: Content IDs may conflict if the target environment already has content at the same locations. Always test imports in Preproduction before Production.
Promotion checklist
Section titled “Promotion checklist”Before promoting to Production:
- All features tested in Preproduction
- Stakeholder sign-off received
- Database migrations are backward-compatible
- Environment variables configured for Production
- Rollback plan documented
- Team notified of the deployment window
- Monitoring dashboards open during deployment
Promotion schedule best practices
Section titled “Promotion schedule best practices”- Deploy early in the week — Avoid Friday deployments when possible; issues discovered over the weekend are harder to resolve
- Deploy during low-traffic hours — Even with zero-downtime deploys, reduced traffic minimizes impact
- Batch related changes — Promote a coherent set of features rather than one change at a time
- Keep a regular cadence — Weekly or bi-weekly promotions prevent large, risky deployments