Feature #11030

Multiple redmine production databases

Added by AndzinSan Dono almost 7 years ago. Updated over 5 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Projects
Target version:-
Resolution:

Description

Feature to load database settings depends on host. For example I want provide redmine to more websites hosted on my server but run it only on one mongrel service.

How to do this?:
In file conf/database.yml
add support for more database settings in production based on host:

production:
  www.onesite.com:
    adapter: mysql
    database: onesite-redmine
    host: localhost
    username: name
    password: pass
    encoding: utf8
  www.twosite.com
    adapter: mysql
    database: twosite-redmine
    host: localhost
    username: name2
    password: pass2
    encoding: utf8

If is redmine loaded on page www.onesite.com/redmine it will load database settings from production/www.onesite.com and repositories will be loaded from repositories dir supplied by host.
Example repository dir for git:

D:\Server\repositories\git\<host>\<project>
D:\Server\repositories\git\www.onehost.com\testproj

Example repository dir for svn:

D:\Server\repositories\svn\<host>\<project>
D:\Server\repositories\svn\www.onehost.com\testproj

To better load production settings, database.yml can be stored separated in conf dir.
Example:

conf/<host>/database.yml

or

conf/<host>.yml

History

#1 Updated by Ebrahim Mohammadi over 5 years ago

I guess this needs to be supported by Rails framework. database.yml is handled by Rails, not directly by Redmine.

Also available in: Atom PDF