How to Set Up a CMS Staging-to-Production Workflow

A proper staging-to-production workflow for CMS platforms prevents content editors and developers from making risky direct changes to a live site. This guide covers implementing this for Drupal/Joomla-based sites.

Why This Matters Beyond Code-Only Deployments

See How to Set Up a Staging Environment That Mirrors Production for general staging principles — CMS platforms add a distinct challenge: content itself changes independently of code, requiring your workflow to handle both code deployment and content synchronization thoughtfully.

The Core Challenge: Content vs Configuration vs Code

LayerTypical Source of Truth
Code (themes, modules)Version control (Git)
Configuration (site settings)Often exportable to version control (Drupal's Configuration Management)
Content (articles, pages)Typically lives only in the database, edited directly by content teams

Drupal's Configuration Management System

drush config:export
drush config:import

Drupal has built-in configuration export/import specifically designed for this workflow — export configuration changes made in a development environment, commit to version control, then import into staging/production, keeping configuration synchronized across environments systematically.

Handling Content Synchronization

Content typically flows the opposite direction from code — rather than syncing content from dev to production, content is usually created/edited directly in a staging or production content environment, with periodic production-to-staging syncs (not staging-to-production) to give content editors realistic data for testing.

A Practical Workflow Pattern

  1. Developers make code/theme changes in a local/dev environment, committed to version control
  2. Configuration changes are exported and included in version control commits
  3. Deploy code + configuration to staging, test thoroughly
  4. Deploy the same tested code + configuration to production (content remains production's own, not overwritten)

Setting Up Automated Deployment for Code/Config

See How to Build a Simple CI/CD Pipeline with GitHub Actions — automate the code and configuration deployment portion of this workflow, while content remains a separate, direct-to-production editorial process.

Periodically Refreshing Staging with Production Content

#!/bin/bash
mysqldump production_db | mysql staging_db
rsync -av production_files/ staging_files/

Regularly refresh staging's content/database from production (not the reverse) so content editors/testers work with realistic, current data — a common and useful practice, just be mindful of any sensitive customer data considerations if applicable.

Handling Content That's Genuinely Part of a Feature Release

For content that's genuinely tied to a specific feature/release (not just routine editorial content), coordinate its creation directly in the target production environment timed with the code release, rather than trying to migrate content between environments.

Testing the Complete Workflow

Verify your configuration export/import genuinely captures all necessary settings, and that your deployment process correctly handles the code+configuration deployment without inadvertently affecting existing production content.

Common Errors

Configuration import overwrites unexpected settings — review exactly what's captured in your configuration export scope; some settings may need to remain environment-specific (like API keys) rather than being included in the synced configuration.

Continue Reading

Browse more articles in CMS Platforms Beyond WordPress.

  • drupal staging production workflow, cms configuration management deployment, drush config export import, cms content sync staging
  • 0 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

How to Install Drupal on a VPS

Drupal is a powerful, highly flexible open-source CMS well-suited for complex content structures,...

How to Install Joomla on a VPS

Joomla is a mature, feature-rich open-source CMS offering a middle ground between WordPress's...

How to Install Craft CMS on a VPS

Craft CMS is a developer-friendly, content-first CMS known for its flexible content modeling and...

How to Install TYPO3 on a VPS

TYPO3 is an enterprise-grade CMS widely used in Europe for large, complex websites needing...

How to Install Grav (Flat-File CMS) on a VPS

Grav is a modern, flat-file CMS — it stores content as files rather than in a database,...