Skip to content

OTOBO Staging System – Migration and Secure Test Environment

OTOBO Staging System – Migration and Secure Test Environment

Section titled “OTOBO Staging System – Migration and Secure Test Environment”

https://softoft.sirv.com/Images/otobo-staging-2.png A staging system is the perfect environment for safely testing changes to your ticket system – whether for OTOBO or Znuny. It is an exact copy of the production system where features, configurations, and data are migrated, tested, and validated – without affecting the live system.

🗾 Compatibility: The steps described in this article apply equally to OTOBO 11.x and Znuny 6.x+. Differences in configuration files are minimal and are noted where necessary.


🔄 Overview: Staging System Migration Workflow

Section titled “🔄 Overview: Staging System Migration Workflow”
  1. Prepare development system
  2. Set up staging system
  3. Copy production data
  4. Test staging
  5. Deploy staging to production (optional)

  • 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

  • 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

A Docker installation is recommended:

Terminal window
sudo apt install docker.io docker-compose
cd /opt
git clone https://github.com/RotherOSS/otobo-docker.git --branch rel-11_0
cd otobo-docker
cp .docker_compose_env_https .env
nano .env # Set OTOBO_DB_ROOT_PASSWORD

If you are using a dev system as a base:

Terminal window
# Delete tickets and attachments
bin/otobo.Console.pl Admin::Delete::Tickets --older 1d --state closed --really
rm -rf /opt/otobo/var/article/*

Terminal window
# Back up database (production system)
mysqldump -u root -p otobo > /tmp/otobo_prod.sql
# Back up articles & Kernel
rsync -avz /opt/otobo/Kernel /tmp/Kernel
rsync -avz /opt/otobo/var/article /tmp/article

Import into staging:

Terminal window
# Import DB
mysql -u root -p otobo_staging < /tmp/otobo_prod.sql
# Copy file system
rsync -avz /tmp/Kernel /opt/otobo/Kernel
rsync -avz /tmp/article /opt/otobo/var/article

🔐 Data Privacy: Anonymize all production customer data, e.g., in the customer_user table, or remove email addresses using an SQL script.


Kernel/Config.pm
$Self->{'Database'}{'Name'} = 'otobo_staging';
$Self->{'Database'}{'User'} = 'otobo';
$Self->{'Database'}{'Password'} = 'STAGING_PASSWORD';

In SysConfig:

  • Set SendmailModule to Kernel::System::Email::DoNotSendEmail
  • Alternatively: Change SMTP server to 127.0.0.1 and port to 1

  • 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

  • Restrict access via VPN or IP whitelist
  • Set robots.txt to 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:

  1. Stop production server
  2. Copy staging database and directories to production
  3. Adjust Config.pm
  4. Restart production

  • Playwright (for E2E tests)
  • rsync for fast data transfer
  • docker-compose for orchestrated environment
  • cron or systemd for regular backups
  • Python scripts for anonymization or structural migration

An OTOBO or Znuny staging system provides maximum security when introducing changes. Through structured migration, anonymized test data, and automated tests, you avoid downtime and ensure stable deployments.

🔁 Tip: Integrate staging processes into your CI/CD pipeline for automated quality assurance with every change.