Redmine database Backup and move

Source: Internet
Author: User
Tags create directory redmine

The backup of Bitnami Redmine is divided into 2 different ways:

1. Export the database

2. Entire Catalog move

No matter what kind of want to stop the service, Redmine related services have the following 5:

Redmineapache

Redminemysql

Redminesubversion

RedmineThin1

RedmineThin2

You can open the Windows Services Control Panel and then stop the top 5 services, or go to Bitnami Redmine's installation directory, double-click Use_redmine.bat, and then enter the console type in the popup:

1
Servicerun.bat  STOP

1. How to export a database

Then start Redminemysql, which is because we want to use redminesql, in fact if the above steps, if you are in the Windows Services Control Panel kind of manual stop service,
You can stop the other 4 services while retaining the Redminesql service.

Double-click Use_redmine.bat in the popup command-line window to type in:

1
Mysqldump-u root-p bitnami_redmine > Backup.sql

The entire redmine system's data is then backed up to the Backup.sql database file, which is under the Redmine root directory.
Note that the root password is the same as your admin password.
The next step is to install the new redmine on the new server, and then import the Backup.sql database file just now.

2. Entire Catalog move

After all services have been stopped, copy the entire Bitnami Redmine stack directory to the new server.
Note that in this way, the path to the Redmine on the new server must be consistent with the path on the old server, for example: Old installation on, C:\Program Files\bitnami Redmine Stack
Then you must copy the Bitnami Redmine stack to the C:\Program Files Directory of the new server.

Then double-click on the Use_redmine.bat, in the popup command line window type type:

1
Serviceinstall.bat  INSTALL

If successful, you can check that the services listed above are in the boot state.

This completes the backup of the Redmine.

Linux Backup:

1. Preparation The Ruby gem dependency package and database are all ready to begin the actual configuration of the Redmine installation:

Configuring Redmine Data Connections
Copy Config/database.yml.example config/database.yml

Vim config/database.yml
Production
ADAPTER:MYSQL2//If Ruby is version 1.9, be sure to write MYSQL2
Database:redmine
Host:localhost
Username:redmine
Password:my_password


Note: The official original text hint MySQL database using ruby1.9 (adapter must be set to MYSQL2) Please note that I started not to notice, back rake, always prompt that the databases adapter is not installed.

Creating Sessin Storage Scripts
Rake Generate_secret_token
Will produce CONFIG/INITIALIZERS/SECRET_TOKEN.RB

CREATE DATABASE structure: [[email protected] redmine-2.0.0]# rails_env=production rake db:migrate
Rake aborted!
Please install the MYSQ2 adapter: ' Gem install Activerecord-mysq2-adapter ' (Cannot load such file--Active_record/connect Ion_adapters/mysq2_adapter)
Workaround:
Gem Uninstall MYSQL2
Gem install mysql2-v "0.3.11"


[Email protected] redmine-2.0.0]# rails_env=production rake db:migrate
Rake aborted!
Please install the MYSQ2 adapter: ' Gem install Activerecord-mysq2-adapter ' (Cannot load such file--Active_record/connect Ion_adapters/mysq2_adapter)

Here to eat a dark loss, please see DATABASE.YML confirm adapter for MYSQL2 instead of MYSL2

To create a database structure:
Rails_env=production Rake Db:migrate

Insert the default configuration data:
[Email protected] redmine]# rails_env=production rake redmine:load_default_data

Select Language:ar, BG, BS, CA, CS, Da, DE, El, en, En-gb, ES, ET, EU, fa, Fi, FR, GL, he, HR, Hu, id, it, ja, KO, lt, lv , MK, MN, NL, no, PL, PT, pt-br, RO, Ru, SK, SL, Sq, sr, Sr-yu, SV, Th, TR, UK, VI, zh, zh-tw [en] en
====================================
Default configuration data loaded.
Create a related directory
[Email protected] redmine]# mkdir tmp public/plugin_assets
mkdir: Unable to create directory "TMP": File already exists
[Email protected] redmine]# chmod-r 755 files log tmp public/plugin_assets
[Email protected] redmine]#
Test 3000 environment
[[email protected] redmine] #ruby/opt/redmine/script/rails server WEBRICK-E production

Access Redmine via Aapche

Background Run Redmine
Nohup Ruby Script/rails server WEBRICK-E production &

Add a virtual host to the Apache configuration file

<virtualhost *:80>
       ServerName redmine.company.com
        proxypass/http://localhost:3000/
       Proxypassreverse/http://localhost:3000/
</virtualhost>

Backup and Recovery
Backup and recovery is a constant topic in enterprise applications.

Redmine user and problem information is stored in the MySQL database, the table name is Redmine and attachments and other resources are stored in the files directory of the Redmine installation directory.
So if you need to migrate, you only need to back up the corresponding tables and files directory of the MySQL database.
1. Back up the MySQL database.
View Redmine/mysql/config/database.yml
Remember the username and password of the production field.
Then Console Root Authority Execution: mysqldump-u username-p redmine >/path/redmine_bak.sql
Then the backup attachment.
$ CD Redmine
$ tar cvzf/var/files_bak.tar.gz./files/
2. Redmine Recovery
Attachment Library Recovery
Extract the/var/files_bak.tar.gz of the backup directly into the/redmine/files directory
MySQL Recovery
Run under the root user:
$ mysql-u root-p Redmine </var/redmine_bak.sql

3, after the restoration is completed, start Redmine,
$ CD Redmine
$ Ruby SCRIPT/SERVER-E Production
If the page is garbled, you can edit the redmine/mysql/config/database.yml and comment out the encoding of the production field.

Redmine database Backup and move

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.