Project

General

Profile

Installed new version over old - Recovery of old mysql DB from files ?

Added by Stephan Jønsson over 8 years ago

Hi guys.

I need some help.
without backing up the old MYSQL DB i installed the new redmine onto my server - and i overwrote the DB/ dumped the data.
Now i see there are data files contaning some info a MYSQL/DATA and ive played around with moivng them into the new location only problem is that this fails.
The log does seem to find revert points for the data but it wont run the Thin_redmine 1 or 2

Im on:
BITNAMI REDMINE 3.2.1-0 from 3.0.1-0
Windows 2008 R2 64bit.

can anyone help a newbi ?


Replies (2)

RE: Installed new version over old - Recovery of old mysql DB from files ? - Added by Stephan Jønsson over 8 years ago

Okay some of you PM'ed me about moving the FRM files and IBDATA file.

That seems to have done the trick BUT i get an internal error after succesfull login.

ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'tokens.updated_on' in 'order clause': SELECT `tokens`.`id` FROM `tokens` WHERE `tokens`.`user_id` = 6 AND `tokens`.`action` = 'session' ORDER BY `tokens`.`updated_on` DESC LIMIT 18446744073709551615 OFFSET 9):
app/models/token.rb:84:in `delete_previous_tokens'
app/models/user.rb:399:in `generate_session_token'
app/controllers/application_controller.rb:82:in `start_user_session'
app/controllers/application_controller.rb:160:in `logged_user='
app/controllers/account_controller.rb:257:in `successful_authentication'
app/controllers/account_controller.rb:203:in `password_authentication'
app/controllers/account_controller.rb:189:in `authenticate_user'
app/controllers/account_controller.rb:40:in `login'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Can anyone help with this ?
Some fora have suggested that you can use

rake tmp:cache:clear
rake tmp:sessions:clear

But that gives me trouble as i get :
rake aborted! - you have already activated rake 10.1.0 but your gemfiles requires rake 10.5.0

RE: Installed new version over old - Recovery of old mysql DB from files ? - Added by Stephan Jønsson over 8 years ago

Stephan Jønsson wrote:

Hi guys.

I need some help.
without backing up the old MYSQL DB i installed the new redmine onto my server - and i overwrote the DB/ dumped the data.
Now i see there are data files contaning some info a MYSQL/DATA and ive played around with moivng them into the new location only problem is that this fails.
The log does seem to find revert points for the data but it wont run the Thin_redmine 1 or 2

Im on:
BITNAMI REDMINE 3.2.1-0 from 3.0.1-0
Windows 2008 R2 64bit.

can anyone help a newbi ?

Okey.

rake tmp:cache:clear
rake tmp:sessions:clear
works with "bundle exec" in front but dosnt fix anything.

I tracked the problem down to the differences in the databases/tables/collums.

So i tried to run : ruby bin/rake db:migrate RAILS_ENV=production
to update/ migrate it.
Only to run into the problem of a error of "tablespace for table exists" so that fails.

What it seems like the only way google knows how to remove that is by creating a new DB.

So then i needed to export the data (found out it did work with rebuilding the old data by coping over the data files, neat!)
problem here is that some of the tables like "custom_field_enumarations" - Doesn't exist when using LOCK TABLES.

I used MYSQL workbench that lets me chose what tables i pull out to a backup.sql file. that were 4 in total that wouldn't work. made my backup of those.

dumped the database and followed the guides :

wiki.bitnami.com/Applications/BitNami_Redmine#How_to_upgrade_Redmine.3f
wiki.bitnami.com/Components/MySQL#How_to_create_a_database_backup.3f
community.bitnami.com/t/problems-updating-bitnami-redmine-3-0-to-3-2-on-windows/38594/12

created a new, imported the backup, ran the migration ruby command and BOOM everything works.

TL:DR
well you really should :P

    (1-2/2)