Project

General

Profile

Migrating from 0.8.7 (manual install) to 1.1.0 (ubuntu repo via apt)

Added by Caspar MacRae almost 14 years ago

Hi,

First please forgive my ignorance as I'm not a Ruby person :-/
And second Redmine absolutely rocks.

We've had a 0.8.7 Redmine install (mongrel) for sometime now and are very happy with it, but desperately need to upgrade as changes to our process management now make subtasking a necessity.

The primary issues is I don't seem to be able to migrate the database:

user@host:/usr/share/redmine$ sudo rake db:migrate RAILS_ENV=production  --trace
(in /usr/share/redmine)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  AddLftAndRgtIndexesToProjects: migrating ==================================
-- add_index(:projects, :lft)
rake aborted!
An error has occurred, this and all later migrations canceled:

PGError: ERROR:  column "lft" does not exist
: CREATE  INDEX "index_projects_on_lft" ON "projects" ("lft")
/usr/lib/ruby/1.8/active_record/connection_adapters/abstract_adapter.rb:219:in `log'
/usr/lib/ruby/1.8/active_record/connection_adapters/postgresql_adapter.rb:550:in `execute'
/usr/lib/ruby/1.8/active_record/connection_adapters/abstract/schema_statements.rb:272:in `add_index'
/usr/lib/ruby/1.8/active_record/migration.rb:352:in `send'
/usr/lib/ruby/1.8/active_record/migration.rb:352:in `method_missing'
/usr/lib/ruby/1.8/active_record/migration.rb:328:in `say_with_time'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/active_record/migration.rb:328:in `say_with_time'
/usr/lib/ruby/1.8/active_record/migration.rb:348:in `method_missing'
./db/migrate//20091220183509_add_lft_and_rgt_indexes_to_projects.rb:3:in `up_without_benchmarks'
/usr/lib/ruby/1.8/active_record/migration.rb:282:in `send'
/usr/lib/ruby/1.8/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/active_record/migration.rb:365:in `__send__'
/usr/lib/ruby/1.8/active_record/migration.rb:365:in `migrate'
/usr/lib/ruby/1.8/active_record/migration.rb:486:in `migrate'
/usr/lib/ruby/1.8/active_record/migration.rb:560:in `call'
/usr/lib/ruby/1.8/active_record/migration.rb:560:in `ddl_transaction'
/usr/lib/ruby/1.8/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/1.8/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/1.8/active_record/migration.rb:560:in `ddl_transaction'
/usr/lib/ruby/1.8/active_record/migration.rb:485:in `migrate'
/usr/lib/ruby/1.8/active_record/migration.rb:472:in `each'
/usr/lib/ruby/1.8/active_record/migration.rb:472:in `migrate'
/usr/lib/ruby/1.8/active_record/migration.rb:400:in `up'
/usr/lib/ruby/1.8/active_record/migration.rb:383:in `migrate'
/usr/share/redmine/vendor/rails/railties/lib/tasks/databases.rake:116
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

So I manually added the columns lft rft by looking through the DDLs, however I must be missing the default values as everything is skewed (projects are nested very deeply where before they weren't related).

I then tried with a new, empty dB - thinking I could just create some projects, subprojects and tasks (issues) with subtasks, but when I look at Redmine's UI there's a lot of template variables that aren't replaced, e.g. TRACKER: {{count}} open / {{total}} and (1-2/2) | Per page: {{value}} on various pages

I'm desperate to get this new version into use, it looks fantastic but I can't request extra time to manually migrate data where there appear to be issues elsewhere.

Do I need to extract all dB DDLs from versions between 0.8.7 and 1.1.0 and apply these? (Would something like this also fix the other problems I'm seeing?)

I'm certain this 99% user error and I'm missing something elegantly simple, can anyone please tell me what I need to do to migrate the data and fix the template variable issue?

Any advice gratefully excepted.

thanks,
Caspar

Using Redmine 1.1.0, with Postgres 8.4 on a Ubuntu x86_64 (VMWare) after generating an empty dB.

sudo RAILS_ENV=production script/about

./script/../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
About your application's environment
Ruby version              1.8.7 (x86_64-linux)
RubyGems version          1.3.7
Rack version              1.1
Rails version             2.3.5
Active Record version     2.3.5
Active Resource version   2.3.5
Action Mailer version     2.3.5
Active Support version    2.3.5
Edge Rails revision       unknown
Application root          /usr/share/redmine
Environment               production
Database adapter          postgresql
Database schema version   20091205124427

Replies (2)

RE: Migrating from 0.8.7 (manual install) to 1.1.0 (ubuntu repo via apt) - Added by Caspar MacRae almost 14 years ago

The db changelog issue was because we had a some db screwups - renamed a bad table and restored from backup, but in postgres the sequence generator was the reassigned to belong to the corrupted table's id column (ie. it had been moved).

So no issue migrating the data, but the template issue is more severe that I initially thought - we cannot send email notifications, as nobody seems to be looking at this help request I'm going to file it as a bug (which it appears to be).

RE: Migrating from 0.8.7 (manual install) to 1.1.0 (ubuntu repo via apt) - Added by Caspar MacRae almost 14 years ago

The other issue (again user fail) was due to incorrect il8n.

sudo gem  install -v=0.4.2 i18n
sudo gem uninstall i18n -v=0.5.0
    (1-2/2)