Question

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

Was it helpful?

Solution

This will do just fine:

mysqldump --single-transaction --user=user_name --password=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

OTHER TIPS

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.

Bitnami apps are self contained, so another option if you can afford some downtime, is simply to shutdown the server, and zip the directory contents ... You may want to do this maybe once a week, in addition to your mysqldump backups. This way you also capture any changes that may have happened in Apache, etc.

Read the Redmine user guide (look at the bottom).

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 <username> -p<password> <redmine_database> | gzip > /path/to/backup/db/redmine_`date +%y_%m_%d`.gz

# Attachments
rsync -a /path/to/redmine/files /path/to/backup/files

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.

By the way, you have to back up the files directory as well; it holds all uploaded files. I installed the Bitnami Redmine stack on Windows.

For MySQL, I use MySQLAdmin to schedule database backup every day. And I use aceBackup to automatic backup database dump files and Redmine uploaded files to a remote FTP server.

When the server is something wrong, I can just reinstall the Bitnami Redmine stack, and import early dumped database file, then cover Redmine's files directory with backup files.

And that's OK.

This separate program (Bitnami Redmine stack) and data (database & uploaded files) perfectly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top