killed database.yml, can i replace it?

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

killed database.yml, can i replace it?

Postby evylrat » Fri Mar 22, 2013 3:31 pm

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.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

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

Postby bigfoot65 » Fri Mar 22, 2013 9:29 pm

You could try reinstalling Greyhole. There should be guidance in the wiki on how to update. Same procedure would act as a reinstall.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

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

Postby evylrat » Mon Apr 01, 2013 7:25 am

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 %>

Who is online

Users browsing this forum: No registered users and 32 guests