Project

General

Profile

Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack

Added by Martin Martyn over 14 years ago

Dear All,

I have installed new linux server with Redmine 0.9.4-0 bitnami stack.
Now i want to import all data from old (norman redmine 0.7.0RC1) to new server.

I have tried exporting the database with mysqldump.

Then i ran

#rake db:migrate RAILS_ENV=production

and i got the error
rake aborted!

No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in `raw_load_rakefile’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run’
/opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
./ruby/bin/rake:19:in `load’

I try to enter and i get this error
"""...
Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

..."

What i have to do ??? i have to copy something else?


Replies (24)

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

You have to be in the redmine directory to run the command above.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

Thanks Felix!! we advance one step!

I get some errors and when i try to get to redmine i find the same error. "... Internal Error"

redmine:/opt/redmine-0.9.4-0/apps/redmine# ../../ruby/bin/rake --trace db:migrate RAILS_ENV=production
(in /opt/redmine-0.9.4-0/apps/redmine)
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute db:migrate
    rake aborted!
    Mysql::Error: Can't create table 'bitnami_redmine.schema_migrations' (errno: 121): CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `log'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:323:in `execute'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb:114:in `create_table'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:476:in `create_table'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb:320:in `initialize_schema_migrations_table'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/migration.rb:436:in `initialize'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/migration.rb:400:in `new'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/migration.rb:400:in `up'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/migration.rb:383:in `migrate'
    /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/railties/lib/tasks/databases.rake:116
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
    /opt/redmine-0.9.4-0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
    ../../ruby/bin/rake:19:in `load'
    ../../ruby/bin/rake:19

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

Don't try to visit your site until all the migrations are through, it won't work…

Martin Martyn wrote:

Mysql::Error: Can't create table 'bitnami_redmine.schema_migrations' (errno: 121): CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB

Well, the error is quite explicit, isn't it?

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

Sorry, but to me is not explicit.

I don´t know what this error means!

Do you have any idea???

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

I have installed new linux server with Redmine 0.9.4-0 bitnami stack AGAIN

Now i want to import all data from old server(normal redmine 0.7.0RC1) to the new server.

So i follow "update to a new Redmine Stack" from http://bitnami.org/article/how-to-backup-and-update-the-bitnami-redmine-stack

I have tried exporting the database with mysqldump.

Importing data base seems OK. (old database REDMINE / New databa bitnami_redmine)

(mysql -u root -p bitnami_redmine < /root/REDMINE.SQL )

I supouse mysql import DB is ok because appears an old table that didn´t exist in new DB. (schema_info)

I paste you the migrations details:


bash-3.2# rake tmp   db:migrate RAIN LS_ENV=production
(in /opt/redmine-0.9.4-0/apps/redmine)
bash-3.2# rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production
(in /opt/redmine-0.9.4-0/apps/redmine)
Cannot find old migration table - assuming nothing needs to be done
bash-3.2# rake db:migrate:pluginns RAILS_ENV=production
(in /opt/redmine-0.9.4-0/apps/redmine)
bash-3.2# rake tmp_cac    :cache:clear
(in /opt/redmine-0.9.4-0/apps/redmine)
bash-3.2# rake tmp:cache:sessions
(in /opt/redmine-0.9.4-0/apps/redmine)
bash-3.2# exit
exit
redmine:/opt/redmine-0.9.4-0# . /ctlscript.sh restart
/opt/redmine-0.9.4-0/subversion/scripts/ctl.sh : subversion stopped
/opt/redmine-0.9.4-0/apache2/scripts/ctl.sh : httpd stopped
/opt/redmine-0.9.4-0/mysql/scripts/ctl.sh : mysql stopped
/opt/redmine-0.9.4-0/mysql/scripts/ctl.sh : mysql  started at port 3306
/opt/redmine-0.9.4-0/apache2/scripts/ctl.sh : httpd started at port 80
/opt/redmine-0.9.4-0/subversion/scripts/ctl.sh : subversion started at port 3690

Then I tried to get in to the web interface. The principal page,conexion page ,register page, and administration goes OK . But all links relative with proyect fails with:

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

Back

The log in production.log when i try to enter to proyect link is below:

redmine:/opt/redmine-0.9.4-0# cat apps/redmine/log/production.log 
# Logfile created on Fri Aug 06 12:49:22 +0000 2010

Processing WelcomeController#index (for 172.28.66.147 at 2010-08-06 13:13:20) [GET]
  Parameters: {"action"=>"index", "controller"=>"welcome"}
Rendering template within layouts/base
Rendering welcome/index
Completed in 360ms (View: 256, DB: 24) | 200 OK [http://172.28.66.15/redmine/]

Processing ProjectsController#index (for 172.28.66.147 at 2010-08-06 13:13:25) [GET]
  Parameters: {"action"=>"index", "controller"=>"projects"}

ActiveRecord::StatementInvalid (Mysql::Error: Unknown column 'lft' in 'order clause': SELECT * FROM `projects` WHERE (projects.status=1 AND projects.is_public = 1)  ORDER BY lft):
  app/models/project.rb:210:in `find'
  app/controllers/projects_controller.rb:54
  app/controllers/projects_controller.rb:52:in `index'

Rendering /opt/redmine-0.9.4-0/apps/redmine/public/500.html (500 Internal Server Error)
redmine:/opt/redmine-0.9.4-0/apps/redmine/log# 

Any idea??????

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

correction

First square , first line:

bash-3.2# rake db:migrate RAIN LS_ENV=production

First square , 8º line:

bash-3.2# rake tmp:cache:clear

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

You must have had a glitch in the database migration (to be honest, I'm surprised it didn't error out), open a redmine console (in your redmine directory, call RAILS_ENV=production ./script/console) and try:

Project.rebuild!

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

I have tried with project.rebuild but it takes many error and didn´t finish.

I am getting crazy!!

Thanks for all the help !!

bash-3.2# pwd
/opt/redmine-0.9.4-0/apps/redmine
bash-3.2# RAILS_ENV=production
bash-3.2# ./script/console
Loading development environment (Rails 2.3.5)
/opt/redmine-0.9.4-0/apps/redmine/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
/opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection':ActiveRecord::AdapterNotSpecified: development database is not configured
/opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:440:in `load_missing_constant':NameError: uninitialized constant ApplicationHelper::GravatarHelper
>> Project.rebuild!
ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1265:in `table_exists?'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1404:in `inspect'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb:5:in `to_str'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb:5:in `to_s'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb:5:in `message'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb:5:in `missing_name'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb:16:in `missing_name?'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:439:in `load_missing_constant'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:96:in `const_missing'
    from /opt/redmine-0.9.4-0/apps/redmine/app/models/project.rb:25
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `load_file'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:379:in `load_file'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:259:in `require_or_load'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:425:in `load_missing_constant'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
    from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
    from (irb):1>> ^C
>> quit

development database is not configured -> THIS IS CORRECT. I have only production configured.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

You must either

export RAILS_ENV=production
./script/console

or

RAILS_ENV=production ./script/console

Just stating SOMETHING=foo sets the environment variable only for that command, not for the rest of the session.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

Now the error is different. It´s look better

bash-3.2# RAILS_ENV=production ./script/console
Loading production environment (Rails 2.3.5)
/opt/redmine-0.9.4-0/apps/redmine/config/../vendor/rails/railties/lib/rails/gem_                                  dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated an                                  d will be removed on or after August 2010.  Use #requirement
>> Project.rebuild!
ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'projects.lft' in '                                  where clause': SELECT count(*) AS count_all FROM `projects`  LEFT OUTER JOIN `pr                                  ojects` AS parent ON `projects`.`parent_id` = parent.id WHERE (`projects`.`lft`                                   IS NULL OR `projects`.`rgt` IS NULL OR `projects`.`lft` >= `projects`.`rgt` OR (                                  `projects`.`parent_id` IS NOT NULL AND (`projects`.`lft` <= parent.`lft` OR `pro                                  jects`.`rgt` >= parent.`rgt`)))
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/abstract_adapter.rb:219:in `log'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/mysql_adapter.rb:323:in `execute'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/mysql_adapter.rb:608:in `select'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_                                  without_query_cache'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/abstract/query_cache.rb:62:in `select_all'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/abstract/database_statements.rb:13:in `select_one                                  '
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/connection_adapters/abstract/database_statements.rb:19:in `select_val                                  ue'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/calculations.rb:237:in `execute_simple_calculation'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/calculations.rb:134:in `calculate'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/calculations.rb:130:in `catch'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/calculations.rb:130:in `calculate'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/rails/activerecord/lib/act                                  ive_record/calculations.rb:48:in `count'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/plugins/awesome_nested_set                                  /lib/awesome_nested_set.rb:126:in `left_and_rights_valid?'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/plugins/awesome_nested_set                                  /lib/awesome_nested_set.rb:112:in `valid?'
        from /opt/redmine-0.9.4-0/apps/redmine/vendor/plugins/awesome_nested_set                                  /lib/awesome_nested_set.rb:167:in `rebuild!'
        from (irb):1

You have good eye

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

I get the same error with migration to v1.0.0 (Bitnami)
It seems to be a schema migration error.

'Projects' table is not updated well by rake db:migrate...!

Rhodan

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

This should happen in migration 104 (source:/trunk/db/migrate/104_add_projects_lft_and_rgt.rb), please see if bitnami actually ships those correctly in the different versions.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

This file is present in the right folder from Bitnami module v1.0.0

/db/migrate/104_add_projects_lft_and_rgt.rb

class AddProjectsLftAndRgt < ActiveRecord::Migration
  def self.up
    add_column :projects, :lft, :integer
    add_column :projects, :rgt, :integer
  end

  def self.down
    remove_column :projects, :lft
    remove_column :projects, :rgt
  end
end

looks like the repository.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

Here the list from initial Redmine version

Rhodan

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

I have absolutely no clue why the migration didn't pick that up… Well, you could add them yourself I guess, you'd need to go into your redmine directory, call ./script/console and then Project.rebuild! though.

Could you provide a dump of the schema_migrations table?

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

I already process "Project.rebuild!"
And I get the same output than Martin :

ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'projects.lft' in....

Rhodan

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

Felix Schäfer wrote:

I have absolutely no clue why the migration didn't pick that up… Well, you could add them yourself I guess

By "them" I meant the columns lft and rgt in the projects table, you will only be able to successfully "rebuild" the project tree after that.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

I'm not sure to what to add in which place

CREATE TABLE `projects` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL DEFAULT '',
`description` text,
`homepage` varchar(60) DEFAULT '',
`is_public` tinyint(1) NOT NULL DEFAULT '1',
`parent_id` int(11) DEFAULT NULL,
`projects_count` int(11) DEFAULT '0',
`created_on` datetime DEFAULT NULL,
`updated_on` datetime DEFAULT NULL,
`identifier` varchar(20) DEFAULT NULL,
`status` int(11) NOT NULL DEFAULT '1',
'lft' int(11) DEFAULT NULL,
'rgt' int(11) DEFAULT NULL,

PRIMARY KEY (`id`)
)

Is it rigth?

Rhodan

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Felix Schäfer over 14 years ago

Don't recreate the whole table, that will only work if you delete the whole table before, and you wouldn't want that, right? I'll try to post an SQL file for that.

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

yes it seems the default value for project lft or rgt is not NULL but something else.

if you can indicate me how to reorganize manually this table I will do.

thanks for your help

Rhodan

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

I have added the two missing columns to the table project (lft and rgt).


mysql> use bitnami_redmine;

Database changed

mysql> alter table projects add rgt int(11) DEFAULT NULL;

Query OK, 40 rows affected (0.02 sec)
Records: 40  Duplicates: 0  Warnings: 0

mysql> alter table projects add lft int(11) DEFAULT NULL;

Query OK, 40 rows affected (0.02 sec)
Records: 40  Duplicates: 0  Warnings: 0

mysql> quit

Then i have rebuilt the project.


bash-3.2# RAILS_ENV=production ./script/console
Loading production environment (Rails 2.3.5)
/opt/redmine-0.9.4-0/apps/redmine/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

>> Project.rebuild!

=> [#<Project id: 14, name: "Añadir *F4", description: "Añadir en la liquidación de booking el *F4 para e...", homepage: "", is_public: true, parent_id: nil, projects_count: 0, created_on: "2009-08-06 07:00:34", updated_on: "2010-08-18 13:18:57", identifier: "bok0u22r", status: 1, lft: 1, rgt: 2>, #<Project id: 17, name: "AS400", description: "", homepage: "", is_public: true, parent_id: nil, projects_count: 22, created_on: "2010-04-20 17:07:09", updated_on: "2010-08-18 13:18:57", identifier: "as400", status: 1, lft: 3, rgt: 72>, #<Project id: 2, name: "AS400PDF", description: "Sustitución de Lisva para generación de documento...", homepage: "", is_public: true, parent_id: nil, projects_count: 0, created_on: "2009-06-29 11:34:37", updated_on: "2010-08-18 13:18:57", identifier: "as400pdf", status: 1, lft: 73, rgt: 74>, #<Project id: 8, name: "Cadiz Las Palmas", description: "Nuevo menú para CADIZ y Las Palmas", homepage: "", is_public: true, parent_id: nil, projects_count: 0, created_on: "2009-07-30 12:39:54", updated_on: "2010-08-18 13:18:58", identifier: "menu", status: 1, lft: 75, rgt: 76>, #<Project id: 1, name: "ImpresorasAS", description: "Configuración de impresoras en AS400", homepage: "", is_public: true, parent_id: nil, projects_count: 0, created_on: "2009-06-29 10:10:00", updated_on: "2010-08-18 13:18:58", identifier: "asprt", status: 1, lft: 77, rgt: 78>, #<Project id: 12, name: "Prueba03-08-09", description: "Este es un proyecto para verificar el funcionamient...", homepage: "", is_public: true, parent_id: nil, projects_count: 0, created_on: "2009-07-30 13:13:39", updated_on: "2010-08-18 13:18:58", identifier: "prueba03-08-09", status: 1, lft: 79, rgt: 80>]

>> quit

Then i tried to enter. And now something have changed. I can get in the project section and I see the list of project !!! BUT when i try to enter to one project i get the internal error again.

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

Back

I paste you the redmine production.log


Processing ProjectsController#show (for 172.28.66.147 at 2010-08-18 13:38:16) [GET]
  Parameters: {"action"=>"show", "id"=>"bok002r", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/show

ActionView::TemplateError (Mysql::Error: Unknown column 'versions.sharing' in 'where clause': SELECT count(DISTINCT `versions`.id) AS count_all FROM `versions`  LEFT OUTER JOIN `projects` ON `projects`.id = `versions`.project_id WHERE (projects.id = 10 OR (projects.status = 1 AND ( versions.sharing = 'system' OR (projects.lft >= 3 AND projects.rgt <= 72 AND versions.sharing = 'tree') OR (projects.lft < 4 AND projects.rgt > 5 AND versions.sharing IN ('hierarchy', 'descendants')) OR (projects.lft > 4 AND projects.rgt < 5 AND versions.sharing = 'hierarchy')))) ) on line #45 of app/views/layouts/base.rhtml:
42:
43:     <% if display_main_menu?(@project) %>
44:     <div id="main-menu">
45:         <%= render_main_menu(@project) %>
46:     </div>
47:     <% end %>
48: </div>

    lib/redmine.rb:146
    lib/redmine/menu_manager.rb:282:in `call'
    lib/redmine/menu_manager.rb:282:in `allowed_node?'
    lib/redmine/menu_manager.rb:252:in `menu_items_for'
    lib/redmine/menu_manager.rb:251:in `each'
    lib/redmine/menu_manager.rb:251:in `menu_items_for'
    lib/redmine/menu_manager.rb:176:in `render_menu'
    lib/redmine/menu_manager.rb:166:in `render_main_menu'
    app/views/layouts/base.rhtml:45:in `_run_rhtml_app47views47layouts47base46rhtml'

Rendering /opt/redmine-0.9.4-0/apps/redmine/public/500.html (500 Internal Server Error)

are we bringing closer to the solution????

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

I was with same status so I stop using migration process.
You need to add for "version" table :
`sharing` varchar(255) NOT NULL DEFAULT 'none'
but also modify yours entries to add 'none' for each row.

Currently I edit all the SQL Dump from previous to match with the Dump from new installation where I configurated a project, a subproject, including roadmap, issues, document, files...

Currently all seems working except the list of issues and roadmap from imported projects (OK for new projects).
Requested page generates error 500 without any log, so it's difficult to find error. SQL import is OK... I'm looking for.

Rhodan

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Martin Martyn over 14 years ago

Do you believe this is a bug????

Did you report it????

i am afraid that if we solve it in this way in future we could have stability problems!

what do you think about ?

RE: Redmine 0.7.0RC1 to Redmine 0.9.4-0 bitnami stack - Added by Perry Rhodan over 14 years ago

I agree it's not the right way.
But it seems the migration process doesn't work in some case. Probably because we started from a too old version with too many changes in DB format.
the rake db:migrate doesn't support our old DB structure.

Maybe it's a bug, but currently we seems to be the both encountering this problem so I don't want to generalize.

Rhodan

    (1-24/24)