Page 1 of 1

killed database.yml, can i replace it?

Posted: Fri Mar 22, 2013 3:31 pm
by evylrat
Whilst trying to fix a problem with greyhole.yml, I aciddentally overwrote database.yml. So I restored it using

Code: Select all

https://github.com/amahi/platform/blob/master/config/database.yml
Today, I have the

Code: Select all

Ruby on Rails application could not be started
error message.

Code: Select all

Error message: Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter)
.

It can only be related to the mucked up database.yml because there is plenty of space on the hard drives. Are there any backups of this file?

Lessons learnt, maybe I should get crashplan to back up all these config files.

Re: killed database.yml, can i replace it?

Posted: Fri Mar 22, 2013 9:29 pm
by bigfoot65
You could try reinstalling Greyhole. There should be guidance in the wiki on how to update. Same procedure would act as a reinstall.

Re: killed database.yml, can i replace it?

Posted: Mon Apr 01, 2013 7:25 am
by evylrat
You could try reinstalling Greyhole. There should be guidance in the wiki on how to update. Same procedure would act as a reinstall.
Tried that, but it did nothing. So I setup a clone server on very similar hardware. Same Amahi version, based on Fedora 14. Then copied the database.yml from the new system, onto the old system, and it worked great.

The reason for setting up the cloned system, is so I can load the greyhole storage up with files, and do a dummy run upgrade to Ubuntu 12. I can test the performance before and after without muching up the real server, and at least it's working now.

Database.yml

Code: Select all

# MySQL (default setup). Versions 4.1 and 5.0 are recommended. # # Install the MySQL driver: # gem install mysql # On MacOS X: # gem install mysql -- --include=/usr/local/lib # On Windows: # There is no gem for Windows. Install mysql.so from RubyForApache. # http://rubyforge.org/projects/rubyforapache # # And be sure to use new-style password hashing: # http://dev.mysql.com/doc/refman/5.0/en/old-client.html development: adapter: mysql database: hda_development username: amahihda password: AmahiHDARulez host: localhost socket: <%= [ '/var/lib/mysql/mysql.sock', # Fedora. '/var/run/mysqld/mysqld.sock', # Ubuntu, Debian. '/tmp/mysqld.sock' # Mac OS X ].select { |f| File.exist? f }.first %> # Warning: The database defined as 'test' will be erased and # re-generated from your development database when you run 'rake'. # Do not set this db to the same as development or production. test: adapter: mysql database: hda_test username: amahihda password: AmahiHDARulez host: localhost socket: <%= [ '/var/lib/mysql/mysql.sock', # Fedora. '/var/run/mysqld/mysqld.sock', # Ubuntu, Debian. '/tmp/mysqld.sock' # Mac OS X ].select { |f| File.exist? f }.first %> production: adapter: mysql database: hda_production username: amahihda password: AmahiHDARulez host: localhost socket: <%= [ '/var/lib/mysql/mysql.sock', # Fedora. '/var/run/mysqld/mysqld.sock', # Ubuntu, Debian. '/tmp/mysqld.sock' # Mac OS X ].select { |f| File.exist? f }.first %>