How to Set Up an OTOBO Staging System
Set up an OTOBO staging system as a safe production copy: migrate the database and files, turn off real outbound mail, anonymize customer data, then validate packages and config before anything reaches live.
🔄 Overview: Staging System Migration Workflow
Section titled “🔄 Overview: Staging System Migration Workflow”- Prepare development system
- Set up staging system
- Copy production data
- Test staging
- Deploy staging to production (optional)
✅ Benefits of a Staging System
Section titled “✅ Benefits of a Staging System”- Safe testing of configuration, custom code & packages
- Automated end-to-end tests using tools like Playwright
- GDPR-compliant testing after anonymization
- Recovery tests & backup verification
🛠 Prerequisites
Section titled “🛠 Prerequisites”- Ubuntu 20.04+ or Debian 10+
- Docker (recommended) or manual Linux installation
- Sufficient system resources (8 GB RAM, 4 CPUs)
- Access to current production data (DB & file system)
- Ability to disable email sending (e.g., via dummy SMTP)
flowchart TD
A[Feature ready for test] --> B[Clean up dev system, delete tickets]
B --> C[Copy dev -> staging]
C --> D[Wait for maintenance window]
D --> E[Back up production data DB & files]
E --> F[Transfer production data to staging]
F --> G[Adjust configuration in staging]
G --> H[Disable email sending]
H --> I[Perform test run]
I -->|Tests successful| J[Optional: Copy staging -> production]
I -->|Tests failed| K[Fix errors and re-test]
J --> L[Activate production]
L --> M[Done, deployment complete]
style D fill:#a9a,stroke:#333,stroke-width:1px
style I fill:#aae,stroke:#333,stroke-width:1px
style J fill:#9a9,stroke:#333,stroke-width:1px
style K fill:#a99,stroke:#333,stroke-width:1px
🧱 Step-by-Step Guide
Section titled “🧱 Step-by-Step Guide”1. Set up Staging System
Section titled “1. Set up Staging System”A Docker installation is recommended:
sudo apt install docker.io docker-composecd /optgit clone https://github.com/RotherOSS/otobo-docker.git --branch rel-11_0cd otobo-dockercp .docker_compose_env_https .envnano .env # Set OTOBO_DB_ROOT_PASSWORD2. Clean up Dev System
Section titled “2. Clean up Dev System”If you are using a dev system as a base:
bin/otobo.Console.pl Admin::Delete::Tickets --older 1d --state closed --reallyrm -rf /opt/otobo/var/article/*3. Copy Production Data
Section titled “3. Copy Production Data”# Back up database (production system)mysqldump -u root -p otobo > /tmp/otobo_prod.sql
# Back up articles & Kernelrsync -avz /opt/otobo/Kernel /tmp/Kernelrsync -avz /opt/otobo/var/article /tmp/articleImport into staging:
# Import DBmysql -u root -p otobo_staging < /tmp/otobo_prod.sql
# Copy file systemrsync -avz /tmp/Kernel /opt/otobo/Kernelrsync -avz /tmp/article /opt/otobo/var/article🔐 Data Privacy: Anonymize all production customer data, e.g., in the
customer_usertable, or remove email addresses using an SQL script.
4. Adjust Configuration
Section titled “4. Adjust Configuration”$Self->{'Database'}{'Name'} = 'otobo_staging';$Self->{'Database'}{'User'} = 'otobo';$Self->{'Database'}{'Password'} = 'STAGING_PASSWORD';5. Disable Email Sending
Section titled “5. Disable Email Sending”In SysConfig:
- Set
SendmailModuletoKernel::System::Email::DoNotSendEmail - Alternatively: Change SMTP server to
127.0.0.1and port to1
🔬 Tests in Staging
Section titled “🔬 Tests in Staging”- Use Playwright or Cypress scripts for UI tests
- Use
bin/otobo.Console.pl Maint::Test::System - Check data integrity & UI behavior
- Disable integrations like LDAP or web services, or redirect them to a test server
🔐 Secure Staging
Section titled “🔐 Secure Staging”- Restrict access via VPN or IP whitelist
- Set
robots.txtto prevent indexing - If necessary, implement Basic Auth via Nginx
- Secure SSL via SAN or wildcard certificate (
*.staging.example.com)
🔄 Optional: Deploy Staging to Production
Section titled “🔄 Optional: Deploy Staging to Production”Once testing is complete in staging:
- Stop production server
- Copy staging database and directories to production
- Adjust
Config.pm - Restart production
🧪 Example Tools for Automation
Section titled “🧪 Example Tools for Automation”Playwright(for E2E tests)rsyncfor fast data transferdocker-composefor orchestrated environmentcronorsystemdfor regular backups- Python scripts for anonymization or structural migration
Conclusion
Section titled “Conclusion”An OTOBO staging system lets you test upgrades, packages, and SysConfig changes on real-shaped data without risking production downtime or accidental customer emails.
🔁 Tip: Integrate staging processes into your CI/CD pipeline for automated quality assurance with every change.
Frequently asked questions
What is an OTOBO staging system?
A near-copy of production used to safely test features, configurations, and migrations without affecting the live system.
Should staging use production data?
Often yes for realistic tests, but anonymize or restrict sensitive data and never point staging mail at real customers.
What should you back up before migration?
Back up the production database and relevant file data (articles and Kernel) before copying them into staging.