Project

General

Profile

Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable

Added by User Emploee over 7 years ago

Good day, Everyone.

Please, help me in my trouble an upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable.

According to manual http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade on step “Step 4 - Update the database” in item

bundle exec rake db:migrate RAILS_ENV=production

command return an error:
C:\RedMine>bundle exec rake db:migrate RAILS_ENV=production
== 20131124175346 AddCustomFieldsFormatStore: migrating =======================
-- add_column(:custom_fields, :format_store, :text)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

TinyTds::Error: Column names in each table must be unique. Column name 'format_store' in table 'custom_fields' is specified more than once.: ALTER TABLE [custom_fields] ADD [format_store] nvarchar(max)
C:/RedMine/db/migrate/20131124175346_add_custom_fields_format_store.rb:3:in `up'
C:in `migrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
C:\RedMine>

In my DB this field [format_store] is present in table [custom_fields] with type varchar(max).

Can I skip this field?
How can I fix it?

My environment:
  • Windows 2008 R2 x64
  • MS SQL Server 2005 x64 with SP2

Redmine about:

Environment:
  Redmine version                3.1.7.stable
  Ruby version                   1.9.3-p484 (2013-11-22) [i386-mingw32]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               SQLServer
SCM:
  Git                            1.9.5
  Filesystem
Redmine plugins:
  no plugin installed


Replies (10)

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by User Emploee over 7 years ago

Hello, Everyone.
Problem with “Step 4 - Update the database” resolved, but next problem appeared with first run updated system.
Start page:

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.

If you are the Redmine administrator, check your log files for details about the error.


data from log:
Completed 500 Internal Server Error in 47ms (ActiveRecord: 31.2ms)

ActiveRecord::StatementInvalid (TinyTds::Error: Incorrect syntax near 'OFFSET'.: EXEC sp_executesql N'SELECT  [settings].* FROM [settings] WHERE [settings].[name] = @0  ORDER BY [settings].[id] DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY', N'@0 nvarchar(255)', @0 = N'rest_api_enabled'):
  app/models/setting.rb:268:in `find_or_default'
  app/models/setting.rb:110:in `[]'
  app/models/setting.rb:230:in `rest_api_enabled?'
  app/controllers/application_controller.rb:123:in `find_current_user'
  app/controllers/application_controller.rb:104:in `user_setup'

Please, help to fix this problem. What I need to do?

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by Toshi MARUYAMA over 7 years ago

RedmineInstall:

Redmine 3.x: (Microsoft SQL Server) 2012 or higher

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by User Emploee over 7 years ago

Toshi MARUYAMA wrote:

RedmineInstall:

Redmine 3.x: (Microsoft SQL Server) 2012 or higher

Thank you very much, Toshi.
Redmine is successfully started, but available only from localhost by link http://localhost:3000/
Connect to Redmine by external link http://IP_address:3000/ or http://hostname:3000/ return the "Unable to connect":

=> Rails 4.2.7.1 application starting in production on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
INFO  WEBrick 1.3.1
INFO  ruby 1.9.3 (2013-11-22) [i386-mingw32]
INFO  WEBrick::HTTPServer#start: pid=3040 port=3000

What I need to do for fix my problem?

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by User Emploee over 7 years ago

Hello, All.
Can you help me to resolve my problem, how to start Redmine after upgrade for access from network, not only from localhost?
Thank you.

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by Toshi MARUYAMA over 7 years ago

$ rails server --help
Usage: rails server [mongrel, thin etc] [options]
    -p, --port=port                  Runs Rails on the specified port.
                                     Default: 3000
    -b, --binding=IP                 Binds Rails to the specified IP.
                                     Default: localhost
    -c, --config=file                Uses a custom rackup configuration.
    -d, --daemon                     Runs server as a Daemon.
    -u, --debugger                   Enables the debugger.
    -e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                     Default: development
    -P, --pid=pid                    Specifies the PID file.
                                     Default: tmp/pids/server.pid

    -h, --help                       Shows this help message.

Do not use webrick for production.

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by User Emploee over 7 years ago

Thank you, Toshi.

But in my case command return next help:

rails server --help

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: C:/Ruby193/bin/ruby.exe
  -m, [--template=TEMPLATE]                              # Path to some application template (can be a filesystem path o
r URL)
      [--skip-gemfile], [--no-skip-gemfile]              # Don't create a Gemfile
  -B, [--skip-bundle], [--no-skip-bundle]                # Don't run bundle install
  -G, [--skip-git], [--no-skip-git]                      # Skip .gitignore file
      [--skip-keeps], [--no-skip-keeps]                  # Skip source control .keep files
  -O, [--skip-active-record], [--no-skip-active-record]  # Skip Active Record files
  -S, [--skip-sprockets], [--no-skip-sprockets]          # Skip Sprockets files
      [--skip-spring], [--no-skip-spring]                # Don't install Spring application preloader
  -d, [--database=DATABASE]                              # Preconfigure for selected database (options: mysql/oracle/pos
tgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                                         # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]                          # Preconfigure for selected JavaScript library
                                                         # Default: jquery
  -J, [--skip-javascript], [--no-skip-javascript]        # Skip JavaScript files
      [--dev], [--no-dev]                                # Setup the application with Gemfile pointing to your Rails che
ckout
      [--edge], [--no-edge]                              # Setup the application with Gemfile pointing to Rails reposito
ry
      [--skip-turbolinks], [--no-skip-turbolinks]        # Skip turbolinks gem
  -T, [--skip-test-unit], [--no-skip-test-unit]          # Skip Test::Unit files
      [--rc=RC]                                          # Path to file containing extra configuration options for rails
 command
      [--no-rc], [--no-no-rc]                            # Skip loading of extra configuration options from .railsrc fil
e

Runtime options:
  -f, [--force]                    # Overwrite files that already exist
  -p, [--pretend], [--no-pretend]  # Run but do not make any changes
  -q, [--quiet], [--no-quiet]      # Suppress status output
  -s, [--skip], [--no-skip]        # Skip files that already exist

Rails options:
  -h, [--help], [--no-help]        # Show this help message and quit
  -v, [--version], [--no-version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

Toshi MARUYAMA wrote:

Do not use webrick for production.

I have 30 users in Redmine and never had problem with Webrick? Why you recommend to use another webservice?

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by Toshi MARUYAMA over 7 years ago

User Emploee wrote:

Toshi MARUYAMA wrote:

Do not use webrick for production.

I have 30 users in Redmine and never had problem with Webrick? Why you recommend to use another webservice?

https://en.wikipedia.org/wiki/WEBrick#Limitations

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by User Emploee over 7 years ago

Toshi MARUYAMA wrote:

https://en.wikipedia.org/wiki/WEBrick#Limitations

Toshi, thank you.
In my case WEBrick Limitation does not give adverse effect.

But the question remains open, how to start redmine for external IP not for localhost only?

RE: Trouble upgrading an existing Redmine installation from 2.5.0.stable to 3.1.7.stable - Added by User Emploee over 7 years ago

Toshi, thank you very much.

Redmine works fine at 0.0.0.0:3000
I was forced to do changes in start command from:

ruby bin/rails server webrick -e production

to
SET RAILS_ENV=production
rails s -b 0.0.0.0 -p 3000

Can I define a parameter to start system in some webrick config file?

    (1-10/10)