Redmine Backup

Objective

Backup Redmine or move Redmine to other server

1. Use mysqldump to backup redmine database in MySQL

1
$ mysqldump -u root -h localhost -p redmine > redmine_backup.sql

2. move your whole Redmine Folder with redmine_backup.sql to your new server

You would need to install Redmine first. If not, please read the article How to install Redmine.

3. create a redmine_backup database in MySQL and import the redmine_backup.sql

1
CREATE DATABASE redmine_backup CHARACTER SET utf8mb4;
1
$ mysql -u root -h localhost -p redmine_backup < redmine_backup.sql

4. Setup the config file in Redmine Folder

Add backup config to config/database.yml:

1
2
3
4
5
6
7
8
backup:                     # production → backup
adapter: mysql2
database: redmine_backup # redmine → redmine_backup
host: localhost
port: 3307
username: root
password: {yourpassword}
encoding: utf8

5. Install Redmine (Optinal)

1
2
3
4
5
6
7
8
9
sudo gem install bundler

# execute under redmine's folder
bundle install --without development test
bundle exec rake generate_secret_token
RAILS_ENV=backup bundle exec rake db:migrate

# Don't do this. This only for new Redmine Database
# RAILS_ENV=backup bundle exec rake redmine:load_default_data

6. Run Redmine Server

1
2
mysql.server restart
bundle exec rails server webrick -e backup -p 5432 # port 5432

Reference:

https://zlargon.github.io/blog/Redmine/install-redmine-on-mac/
https://youtu.be/2-_ZU7N3XEM

Share Comments