Project

General

Profile

New Database database.yml

Added by Chris Xpozay almost 11 years ago

Hi there,

Background
- I engaged a contractor to install ruby/rails and redmine on my vps
- Rather then installing using one of my domains, root was used and as a result the database (mysql) is at the root level rather in my domain. While it works, the problems is that I need to provide root access to any database admin should I need assistance.
- Redmine was installed in public_html/redmine in my preferred domain.
- I do not have any rake/rails/ruby knowledge but can read script such as php

Objective
- I am trying to move the database into one of my domains hosted on the VPS, say mydomain.com

Issues
- Moving the database is done. No problems with this one.
- I see there is a database.yml file which defines the database, userid and password. So simple just modify this and go. OK it doesn't seem to have an effect. Therefore, I assume that either this information is read and stored again elsewhere, in cache, or in a live session

Questions
- I see these commands:
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

So is it correct to say that rails is compiled and load_default is loading up my database.yml settings and stored somewhere and therefore I need to re run those commands? Or is rails a process that loads the default_data and therefore I just need to stop and start the process(es) and the changes will be recognised?

I have copied the linux (centos) commands that I pulled from the history

su -l myacccount
cd /home/myacccount/public_html/redmine
bundle install
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
mkdir -p tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
exit
cd /home/myaccount/public_html/projects && su myaccount -c 'ruby script/rails server webrick -e production'

Can I just re-do all of this? I have data in my database already so I don't really want to loose that but I have a backup and can re-import anyway.

Thanks very much for any assistance / direction you can give me

Chris


Replies (1)

RE: New Database database.yml - Added by Chris Xpozay almost 11 years ago

OK much easier than I thought.

1) Move the database
2. Edit the database.yml file to show the correct database name, user and password
3. log into your account via ssh if you are not already there (I did the above two using cpanel)
4. issue the command killall -9 ruby
5. issue the command "cd /home/accountname/public_html/folder && su accountname -c 'ruby script/rails server webrick -e production' &

where accountname is your login name into cpanel and folder is the path where your redmine is installed

The last command (#5) will reload the database.yml file and use the updated database,user and password

    (1-1/1)