0

I have an active redmine but I can not find the database where it is running right now. It should be on PostgreSQL but the database where it should be running is empty. Does anybody have any idea how to check current database used by redmine?

Please let me know if you need any extra information.

Thank you

EDIT: Ok I know the database it is using. On the database.yml I have project_redmine but it is using the database project I dont know why. That database it is used by developers for the actual project. So that is getting me problems of course. I am unable to run it on the right DB (project_redmine) any ideas? :S

2 Answers 2

1

Like any other Rails app, the database information is stored in the config/database.yml file.

3
  • Thanks for your reply. This files is populated but that database is empty. Seems like is not using this file because even if I use a mysql DB there but I don't load in the bundle the pg gem I got an error saying that gem can not be found. It seems it is taking the info from other place rather than database.yml. Is this posible?
    – zordor
    Dec 15, 2012 at 1:19
  • Did you accidentally start your app in development instead of production, or vice versa? Dec 15, 2012 at 1:20
  • No, that is correct, I am running production
    – zordor
    Dec 16, 2012 at 2:20
0

I figure out how to do this. You need to get into rails console, that is:

RAILS_ENV=production bundle exec rails console

(Well depending on your environment you might need to change production for test or whatever)

Then run

ActiveRecord::Base.connection

And you will get something like this:

ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x7ff679473020 @connection_parameters=["localhost", port, nil, nil, "database", "user", "pass"]

That worked for me. Now I need to figure out why I have those values... but that is a diferent story...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .