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.
(CGI directory)/(installation identifier)/common.ini
Example:
- On Windows:
C:\inetpub\scripts\cbgrn\common.ini - On Linux:
/var/www/cgi-bin/cbgrn/common.ini
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
-
Start the command prompt.
-
Create a destination directory.
mkdir C:\backup\YYYYMMDD
-
Stop the scheduling service.
From the Windows Start menu, select "Administrative Tools" > "Services" to stop the following services:
- Cybozu_Scheduling_Service_cbgrn
-
Confirm that the scheduling service is stopped.
- Start Task Manager.
- On Windows Task Manager, click the "Processes" tab.
- Confirm that sched.exe is not displayed.
-
Set Garoon to backup mode.
cd C:\inetpub\scripts\cbgrn .\grn.exe -C -q code\command\backupmode_start.csp
-
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
-
Specify the database administrator password.
-
Use OS commands to back up attachments.
xcopy "C:\Program Files\Cybozu\mysql-5.0\files" C:\backup\YYYYMMDD\files /e /i
-
Cancel the backup mode.
cd C:\inetpub\scripts\cbgrn .\grn.exe -C -q code\command\backupmode_end.csp
-
Start the scheduling service.
From the Windows Start menu, select Administrative Tools > service, and start the following services.
- Cybozu_Scheduling_Service_cbgrn
-
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
-
Start the command prompt.
-
Create a destination directory.
mkdir -p /backup/YYYYMMDD
-
Stop the scheduling service.
systemctl stop cyss_cbgrn.service
-
Confirm that the scheduling service is stopped.
Run the following command to confirm that the scheduling service is not displayed.
ps -aux | grep cyss
-
Set Garoon to backup mode.
cd /var/www/cgi-bin/cbgrn ./grn.cgi -C -q code/command/backupmode_start.csp
-
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
-
Specify the database administrator password.
-
Use OS commands to back up attachments.
cp -rp /usr/local/cybozu/mysql-5.0/files /backup/YYYYMMDD/
-
Cancel the backup mode.
cd /var/www/cgi-bin/cbgrn ./grn.cgi -C -q code/command/backupmode_end.csp
-
Start the scheduling service.
systemctl start cyss_cbgrn.service
-
Ensure that Garoon can be accessed correctly.