Deployment (Prod & Staging)
Pragma CMS is designed with a "Clean Monolith" architecture. This means moving a site from your local machine to a production server is a simple, predictable process involving the movement of two specific things: your Site Directory and your Database.
1. Local to Production Workflow
Because each site is isolated within the /sites/ folder, the deployment follows a linear path:
- Export the Database: Dump your local MySQL/MariaDB database into a .
sql
file. - Transfer the Site Folder: Upload your specific site directory (e.g.,
/sites/my-awesome-site/)to the same location on your VPS.- Note: You do not need to re-upload the
cms-versions/
folder if the core is already installed on the server.
- Note: You do not need to re-upload the
- Import the Database: Import your
.sqlfile into the server's database (via CLI or a tool like HeidiSQL/TablePlus).
2. Staging Environment
Pragma CMS supports a native Staging workflow to test changes before they go live.
- Isolation: Staging usually lives in a parallel directory (e.g.,
/var/www/pragma-cms-staging/) with its own database. - One-Click Sync: If you used the official installation script, you have access to a deployment utility. Running
sudo /var/www/pragma-cms/scripts/cli/deploy_staging.shwill automatically clone your Production files and database into the Staging environment. - Security: Staging environments are automatically protected by Basic Auth (defined in your Caddyfile) and are set to noindex to prevent search engines from crawling your test data.