DOC-05: Operations and Maintenance (Day 2 Operations)
Recurring maintenance manual, backup automation without credential exposure, and Disaster Recovery plans for Redmine infrastructure.
1. Backup Strategy
Sección titulada «1. Estrategia de Copias de Seguridad (Backups)»The resilience of a corporate environment resides entirely in its disaster recovery capability. To ensure a robust backup strategy, we implement the principle of data segregation and the elimination of plain-text passwords on system terminals.
1.1. Database Backup (Secure MySQL Dump)
Sección titulada «1.1. Copia de Seguridad de Base de Datos (MySQL Dump Seguro)»[!CAUTION] Credential Exposure Risk: Never pass the MySQL password interactively in the terminal (e.g.,
-p"mi_contraseña"). Doing so will record the password in plain text in the bash command history (~/.bash_history) and in the system process table, visible to any local user viaps aux.
To resolve this security breach, we implement a secure MySQL client configuration file (.my.cnf) inside the container or mounted as a volume.
Step 1: Configure the secure credentials file on the host
Sección titulada «Paso 1: Configurar el archivo de credenciales seguro en el host»Create a MySQL client options file within your host server's protected configuration directory:
mkdir -p ~/redmine/config/secretsnano ~/redmine/config/secrets/mysql_backup.cnfAdd the database administration credentials in a structured manner:
[client]user=redminepassword=contrasena_secreta_portelcorehost=redmine_dbStep 2: Apply restrictive permissions to the file system
Sección titulada «Paso 2: Aplicar permisos restrictivos en el sistema de archivos»Only the infrastructure automation service account (portel_user) and the Docker daemon should be able to read this file:
chmod 600 ~/redmine/config/secrets/mysql_backup.cnfStep 3: Mapping and Execution in the Compose file
Sección titulada «Paso 3: Mapeo y Ejecución en el archivo Compose»Ensure that the mysql_backup.cnf file is mounted to the redmine_db service of the docker-compose.yml file in read-only mode (:ro):
services: redmine_db: # ... otras configuraciones volumes: - ./config/secrets/mysql_backup.cnf:/etc/mysql/conf.d/mysql_backup.cnf:roOnce mapped, execute the database dump from your scheduled task script (CRON) without revealing any passwords in the logs or the system history:
# Ejecución segura mediante el uso del archivo de configuración internodocker exec -i redmine_db mysqldump --defaults-extra-file=/etc/mysql/conf.d/mysql_backup.cnf redmine > ~/redmine/backups/redmine_backup_$(date +%F).sql1.2. File Backup (Attachments and Configurations)
Sección titulada «1.2. Copia de Seguridad de Archivos (Adjuntos y Configuraciones)»Redmine stores portal attachments, premium visual themes, and integrated plugins in host directories. To back them up, we create a high-performance compressed archive:
# Compresión recursiva preservando metadatos y permisos originales de Linuxtar -czpf ~/redmine/backups/redmine_assets_$(date +%F).tar.gz -C ~/redmine files themes plugins config2. Disaster Recovery Plan
Sección titulada «2. Plan de Recuperación ante Desastres (Disaster Recovery)»In the event of total data loss or physical host corruption, follow this step-by-step procedure to restore operations on a new node:
- Provisioning: Install the operating system and set up the empty infrastructure following guides DOC-01, DOC-02, and DOC-03.
- Temporary Halt: Stop the application container to avoid write inconsistencies while restoring data:
Ventana de terminal cd ~/redminedocker compose stop redmine - Database Restoration: Import the SQL dump using the already configured secure connection:
Ventana de terminal docker exec -i redmine_db mysql --defaults-extra-file=/etc/mysql/conf.d/mysql_backup.cnf redmine < ~/redmine/backups/redmine_backup_2026-05-22.sql - File Restoration: Unzip the files and plugins into their respective locations on the host, making sure to overwrite the empty persistent directories:
Ventana de terminal tar -xzpf ~/redmine/backups/redmine_assets_2026-05-22.tar.gz -C ~/redmine - Permission Reconfiguration: Reapply the production isolated user (
999) ownership to the file system:Ventana de terminal sudo chown -R 999:999 ~/redmine/files ~/redmine/themes ~/redmine/plugins ~/redmine/config - Complete Boot: Initialize the application again:
Ventana de terminal docker compose start redmine
3. Version Update Procedure (Updates)
Sección titulada «3. Procedimiento de Actualización de Versiones (Updates)»To keep the Redmine instance protected against Ruby on Rails framework vulnerabilities and to leverage the latest performance improvements:
- Backup: Perform a manual backup of the database and attachments (section 1).
- Update the Registry Image: Download the latest official stable version tag:
Ventana de terminal docker compose pull redmine - Stop and Recreation: Stop and lift the stack in the background. Docker will recreate the containers immutably from the new base image:
Ventana de terminal docker compose downVentana de terminal docker compose up -d - Database and Plugin Migration: If the version jump introduces changes to the relational database schema or Redmine plugins, directly invoke the compilation Rake task:
Ventana de terminal docker compose run --rm redmine bundle exec rake redmine:plugins:migrate RAILS_ENV=production
4. Operational Validation Checklist (Maintenance)
Sección titulada «4. Checklist de Validación Operacional (Mantenimiento)»Implement this weekly checklist to ensure the system remains healthy and that maintenance policies are rigorously enforced:
- ✓ Backup Status: Verify that daily SQL dumps are correctly generated in
~/redmine/backups/and are not zero-sized. - ✓ Owner Verification (
UID 999): Ensure that no files uploaded by users through the attachments portal have broken the local server's permission hierarchy. - ✓ Disk Space Sanitization: Purge orphaned images and volumes from the Docker engine to prevent lack of space on the Proxmox hypervisor's virtual hard drive.
- ✓ Lab DNS Consistency: Verify the correct internal resolution of domains under the
*.portelcore.comextension.

