tags:

views:

1585

answers:

4

We started using Redmine at work. I know it uses mySql as the database, and Apache2 as web server. How Redmine can be properly backed up so that it can be reloaded quickly when anything goes wrong?

+2  A: 

This will do just fine:

mysqldump --single-transaction --user=user_name --p=your_password redmine_database > backup.sql

It will dump the entire contents of the redmine_database to the backup.sql file.

Update:

As far as backing up "apache", as I state in my comment below - you don't need or want to back up your apache installation. If you ever need to recover your system, apache would need to be reinstalled as with any other application. If you are referring to the actual files and directories within your redmine installation, those as well don't need to be backed up except for the files/ directory which contains user uploaded files to redmine. You can backup your entire redmine installation (to be safe) with the following command:

tar czvf redmine_backup.tar.gz /path/too/redmine/installation
hobodave
How about Apache? We use LDAP for user authentication. Thanks.
Chenster
Chenster - Apache is an application and generally doesn't need to be backed up. Restoring your apache installation is as simple as reinstalling.
hobodave
how about httpd.conf file? I guess what I meant is anything that could potentially be changed by users should be backedup. Maybe in this case, nothing is changed in Apache2.
Chenster
Chenster, that is correct. Your apache configuration cannot be changed by your Redmine users.
hobodave
mysqldump.exe -uroot -p<Password> bitnami_redmine > <BACKUP DRIVE>\redmine_mysql_backup.sql
Chenster
A: 

Redmine sets table charset as "latin1". So, if you use non-latin1 charset (CJK in UTF-8 or something), you should give following option to backup script.

mysqldump -u root -p --default-character-set=latin1 --skip-set-charset bitnami_redmine -r backup.sql

It skips "set charset blah-blah-blah" on sql dump and you would get a clean(=dump without interpretation) dump.

rein
Misleading and unnecessary. mysqldump dumps the tables in the appropriate character set.
hobodave
In bitname redmine stack all tables are creates as 'latin1'. And Redmine uses table as "utf-8" encoded.Thus, if Redmine stores any data in "utf-8", backup script should skip the charset-enforcement.(The title of the question suggests that Chenster uses bitname redmine stack)
rein
+1  A: 

read the redmine user guide (look at the bottom)

http://www.redmine.org/wiki/redmine/RedmineInstall

also, don't forget to backup the attached files

Redmine backups should include: data (stored in your redmine database) attachments (stored in the files directory of your Redmine install) Here is a simple shell script that can be used for daily backups (assuming you're using a mysql database):

# Database
/usr/bin/mysqldump -u  -p  | gzip > /path/to/backup/db/redmine_`date +%y_%m_%d`.gz

# Attachments
rsync -a /path/to/redmine/files /path/to/backup/files
opensas
WHAT'S A WINDOWS VERSION OF ABOVE?
Chenster
OK, I guess I'm anwering my own question: mysqldump.exe -uroot -p<Password> bitnami_redmine > <BACKUP DRIVE>\redmine_mysql_backup.sql
Chenster
+2  A: 

Run it as a VM (JumpBox has a quickstartable one, I believe) then periodically pause or shutdown the VM and backup/copy the entire virtual disk.

I know this doesn't help with an existing installation, but it's what I'd recommend to anyone planning backups before they implement. That's not meant to be snide, just helpful to anyone else reading this thread.

Binary Phile