Project

General

Profile

Backup Wiki entries offsite

Added by L Philbrook over 13 years ago

Hello,

I was wondering if it was possible to do some sort of automated backup of a project's wiki. I know you can manually go through the a wiki and create HTML or TXT files, but one wiki is over 250 pages. We ran into a situation where our testing server went down. This also runs our Redmine install and has all the instructions for getting the server up and running.

Any thoughts?

Thanks.


Replies (3)

RE: Backup Wiki entries offsite - Added by André Bachmann over 13 years ago

You will find the content of your Redmine wiki in a database, if you used MySQL it can be found and exported with this command:

mysqldump -u redmine -p<yourpassword> redmine_default > mysqldump.sql

It can be restored with:

mysql -u redmine -p<yourpassword> redmine_default < /path/to/backupname.sql

However, I wrote a simple backup script for my entire Redmine installation (and not only the wiki). It looks like this:

#!/bin/sh
timestamp=`date +%Y%m%d_%H%M`

mkdir /usr/backup/tmp$timestamp
rsync -av /etc/redmine /usr/backup/tmp$timestamp/etc_redmine
rsync -av /usr/share/redmine /usr/backup/tmp$timestamp/usr_share_redmine
rsync -av /var/lib/redmine /usr/backup/tmp$timestamp/var_lib_redmine
mysqldump -u redmine -p<yourpassword> redmine_default > /usr/backup/tmp$timestamp/mysqldump.sql

# Compress backup:
cd /usr/backup
tar cjf /usr/backup/redmine/backup_$timestamp.tbz tmp$timestamp/etc_redmine tmp$timestamp/usr_share_redmine tmp$timestamp/var_lib_redmine tmp$timestamp/mysqldump.sql

# Cleaning up:
rm -rf /usr/backup/tmp$timestamp

You can automatically run it with your crontab.

RE: Backup Wiki entries offsite - Added by L Philbrook over 13 years ago

Andre,

Thanks for your answer. I am already backing up the full DB. My problem is specific to the wiki. If I just output the wiki entries from the database. I would loose all the formating. Plus, there would be syntax for repository build references, macro calls and links to other wiki pages throughout the documentation.

Thanks again.

Lloyd

RE: Backup Wiki entries offsite - Added by André Bachmann over 13 years ago

Well, if you look into the table "wiki_content_versions" you will see that there are all entries from your wiki, and they all are formatted the same way as you input them. So copying this table will save their format, too.

But since there are all versions in this table entry, it is quite difficult to get what you really want or need...

Perhaps writing a tool to parse this table and to cherry-pick the entries you really want would come in handy. :D

    (1-3/3)