Backing up Garoon Using mysqldump

This section describes how to use mysqldump to back up data.
During backup, users cannot access Garoon. You have to back up data when users do not have access to Garoon.

Points to Check before Backing Up

Before performing back up using mysqldump, check the followings.

Enabling Backup Mode

Start the database, and perform back up using mysqldump.
Note that the "files" directory must be backed up separately using OS commands. To ensure data integrity, you must prevent the database from being updated during the backup process.
Use the backup mode to prevent users from accessing Garoon during backup.

By default, the backup mode is disabled.
Before starting the back up, modify the configuration file (common.ini) to enable the backup mode.

Path to the "common.ini" file

(CGI directory)/(installation identifier)/common.ini
Example:

  • On Windows:
    C:\inetpub\scripts\cbgrn\common.ini
  • On Linux:
    /var/www/cgi-bin/cbgrn/common.ini
Contents to be modified in the "common.ini" file

Under "BackupMode", delete the "disable = "1"" row.
Before changing:

:
[BackupMode]
disable = "1"
driver = "xxxxx"
:

After change:

:
[BackupMode]
driver = "xxxxx"
:

For Windows

On Windows, use mysqldump to back up data.
This example illustrates the use of MySQL bundled in the installer.

  • Installation identifier: cbgrn
  • CGI directory: C:\inetpub\scripts
  • Directory to be backed up:
    • C:\Program Files\Cybozu\mysql-5.0\data
    • C:\Program Files\Cybozu\mysql-5.0\files
  • Backup destination: C:\backup\YYYYMMDD
Steps:
  1. Start the command prompt.

  2. Create a destination directory.

    mkdir C:\backup\YYYYMMDD

  3. Stop the scheduling service.

    From the Windows Start menu, select "Administrative Tools" > "Services" to stop the following services:

    • Cybozu_Scheduling_Service_cbgrn

  4. Confirm that the scheduling service is stopped.

    1. Start Task Manager.
    2. On Windows Task Manager, click the "Processes" tab.
    3. Confirm that sched.exe is not displayed.

  5. Set Garoon to backup mode.

    cd C:\inetpub\scripts\cbgrn
    .\grn.exe -C -q code\command\backupmode_start.csp

  6. Using the database administrator account, execute mysqldump.

    "C:\Program Files\Cybozu\mysql-5.0\bin\mysqldump" --defaults-file="C:\Program Files\Cybozu\mysql-5.0\etc\my.ini" --all-databases --single-transaction -u cbroot -p > C:\backup\YYYYMMDD\full.sql

  7. Specify the database administrator password.

  8. Use OS commands to back up attachments.

    xcopy "C:\Program Files\Cybozu\mysql-5.0\files" C:\backup\YYYYMMDD\files /e /i

  9. Cancel the backup mode.

    cd C:\inetpub\scripts\cbgrn
    .\grn.exe -C -q code\command\backupmode_end.csp

  10. Start the scheduling service.

    From the Windows Start menu, select Administrative Tools > service, and start the following services.

    • Cybozu_Scheduling_Service_cbgrn

  11. Ensure that Garoon can be accessed correctly.

For Linux

On Linux, you can use mysqldump to back up data.
This example illustrates the use of MySQL bundled in the installer.

  • Installation identifier: cbgrn
  • CGI Directory: /var/www/cgi-bin
  • Directory to be backed up:
    • /usr/local/cybozu/mysql-5.0/data
    • /usr/local/cybozu/mysql-5.0/files
  • Backup destination: /backup/YYYYMMDD
Steps:
  1. Start the command prompt.

  2. Create a destination directory.

    mkdir -p /backup/YYYYMMDD

  3. Stop the scheduling service.

    systemctl stop cyss_cbgrn.service

  4. Confirm that the scheduling service is stopped.

    Run the following command to confirm that the scheduling service is not displayed.

    ps -aux | grep cyss

  5. Set Garoon to backup mode.

    cd /var/www/cgi-bin/cbgrn
    ./grn.cgi -C -q code/command/backupmode_start.csp

  6. Using the database administrator account, execute mysqldump.

    /usr/local/cybozu/mysql-5.0/bin/mysqldump --defaults-file=/usr/local/cybozu/mysql-5.0/etc/my.ini --all-databases --single-transaction -u cbroot -p > /backup/YYYYMMDD/full.sql

  7. Specify the database administrator password.

  8. Use OS commands to back up attachments.

    cp -rp /usr/local/cybozu/mysql-5.0/files /backup/YYYYMMDD/

  9. Cancel the backup mode.

    cd /var/www/cgi-bin/cbgrn
    ./grn.cgi -C -q code/command/backupmode_end.csp

  10. Start the scheduling service.

    systemctl start cyss_cbgrn.service

  11. Ensure that Garoon can be accessed correctly.