Backup und Wiederherstellung

OTOBO bietet fertige Skripte zum Erstellen und Wiedereinspielen von Backups. Für weitere Informationen führen Sie diese mit der Option -h aus.

Backup

Bemerkung

Der Benutzer otobo benötigt im Zielverzeichnis Schreibrechte, damit ein neues Backup erstellt werden kann.

otobo> /opt/otobo/scripts/backup.pl -h

Die Ausgabe des Skriptes:

Backup an OTOBO system.

Usage:
 backup.pl -d /data_backup_dir [-c gzip|bzip2] [-r DAYS] [-t fullbackup|nofullbackup|dbonly]
 backup.pl --backup-dir /data_backup_dir [--compress gzip|bzip2] [--remove-old-backups DAYS] [--backup-type fullbackup|nofullbackup|dbonly]

Short options:
 [-h]                   - Display help for this command.
 -d                     - Directory where the backup files should place to.
 [-c]                   - Select the compression method (gzip|bzip2). Default: gzip.
 [-r DAYS]              - Remove backups which are more than DAYS days old.
 [-t]                   - Specify which data will be saved (fullbackup|nofullbackup|dbonly). Default: fullbackup.


Long options:
 [--help]                     - same as -h
 --backup-dir                 - same as -d
 [--compress]                 - same as -c
 [--remove-old-backups DAYS]  - same as -r
 [--backup-type]              - same as -t

Help:
Using -t fullbackup saves the database and the whole OTOBO home directory (except /var/tmp and cache directories).
Using -t nofullbackup saves only the database, /Kernel/Config* and /var directories.
With -t dbonly only the database will be saved.

Override the max allowed packet size:
When backing up a MySQL one might run into very large database fields. In this case the backup fails.
For making the backup succeed one can explicitly add the parameter --max-allowed-packet=<SIZE IN BYTES>.
This setting will be passed on to the command mysqldump.

Output:
 Config.tar.gz          - Backup of /Kernel/Config* configuration files.
 Application.tar.gz     - Backup of application file system (in case of full backup).
 VarDir.tar.gz          - Backup of /var directory (in case of no full backup).
 DataDir.tar.gz         - Backup of article files.
 DatabaseBackup.sql.gz  - Database dump.

Bemerkung

–extra-dump-options=“–single-transaction“ prevents the database tables from being locked, so OTOBO can still be used during the backup.

Wiederherstellen

Bemerkung

Bevor Sie die Datenbank wiederherstellen, stellen Sie sicher, dass die Datenbank otobo vorhanden ist und keine Tabellen enthält.

otobo> /opt/otobo/scripts/restore.pl -h

Die Ausgabe des Skriptes:

Restore an OTOBO system from backup.

Usage:
 restore.pl -b /data_backup/<TIME>/ -d /opt/otobo/

Options:
 -b                     - Directory of the backup files.
 -d                     - Target OTOBO home directory.
 [-h]                   - Display help for this command.

Nach erfolgreicher Wiederherstellung wird empfohlen, den OTOBO-Cache zu leeren. Führen Sie dazu den folgenden Befehl aus:

# clear OTOBO cache
otobo> /opt/otobo/bin/otobo.Console.pl Maint::Cache::Delete

Sonderfalll: OTOBO und Docker

Die gleichen Skripte können mit OTOBO unter Docker verwendet werden. Allerdings müssen einige Docker-spezifische Einschränkungen beachtet werden. Bitte lesen Sie das Kapitel Backup und Wiederherstellung mit Docker für Informationen zu diesem Fall.