menu_book Navigation menu

Staging Deployment (deploy_staging.sh)

Overview

Testing updates, new themes, or structural changes directly on production is dangerous. The deploy_staging.sh script performs a rapid, 1-to-1 sync from your Production environment to your Staging environment.

warning
Warning
Running this script will completely overwrite the staging database and all staging files.

Execution

BASH
sudo bash /var/www/pragma-cms/scripts/cli/deploy_staging.sh

Syncing Logic

  • Database Cloning: Uses a direct pipe (mysqldump ... | mysql ...) to clone the pragma_cms_platform database directly into pragma_cms_platform_staging entirely in memory, without writing intermediary .sql files to disk.
  • Fast File Sync: Uses rsync -av --delete. This compares files and transfers only what has changed, making it incredibly fast.
  • Safety Exclusions: It explicitly prevents overwriting the staging database credentials by excluding config_db.php. It also skips transferring production caches and logs.
  • Permission Reset: Ensures the staging directory is given back to the www-data user to prevent web server permission denied errors.