Project

General

Profile

Moving Redmine installation

Added by Chris Dalley over 9 years ago

Hi Team

Our old server is on its last legs - unfortunately for us this holds Redmine (Version: 2.4.0).

I was not around for the installation of Redmine, nor did that staff member leave instructions.

I am very new to Apache, Ruby, MySQL etc.

I am looking for step by step instructions (to the point) to move across the installation before the server dies.

Any questions let me know and I will try my best to answer you.

Our server is Windows Server 2008, our new server it is moving to is Windows Server 2012 Standard.

C


Replies (20)

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

- backup your database and files first
- remove any installed plugins (migration + deletion)
- install 3.0 version at new location
- backup database again (without plugins) and import it to existing fresh 3.0 database
- follow Upgrade guide (migrate database, generate secret token, copy files, etc)

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Thanks, I managed to get it working through a lot of blood, sweat and tears.

I managed to, what seems, successfully install Bitnami Redmine 3.0 on my server.
We wanted to move to SQL Server so the database was converted using SSMA (http://blogs.msdn.com/b/ssma/)

I linked it up, I loaded Redmine - all working OK until:

When I try to raise a ticket I am getting an error advising:
"No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses")."

When I browse to this page there are no options around setting a default issue status.
I tried creating a new one, worked fine, but no default option.
I tried deleting created item status and I got a white page advising "The webpage cannot be found" (the standard)

Any ideas?

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

By default the New status has a default value.

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Hi Pavel,

Then can you explain why I am getting that issue?
No obvious errors in the logs.

RE: Moving Redmine installation - Added by Leonel Iturralde over 9 years ago

Hi,

Are there default issue status when you try to create a new tracker or edit one?

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Hi Leonel/Pavel,

I just compared the "Item Statuses" page to our v2.4 Redmine, the default option is present.

However, comparing this to our 3.0 installation it is not (see error.png)

I checked the Database and the is default column is present (see db.png)

Chris

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

Check next:
- administration - tracker - Select each one and check if there Default status assigned.
- if no, then set New and save.

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Hi There,

Thanks for that. It is now sorted however I have got another error.

Whenever raising a new ticket in Redmine or saving any kind of page with settings that handles dates/times I am getting the following error:

TinyTds::Error: Error converting data type nvarchar to datetime2.: EXEC sp_executesql N'INSERT INTO [settings] ([name], [value], [updated_on]) OUTPUT INSERTED.[id] VALUES (Rangicaadmice Rangicaadmice, @1, 2 2)', N'@0 varchar(255), @1 varchar(max), 2 2 datetime2', Rangicaadmice Rangicaadmice = N'search_results_per_page', @1 = N'10', 2 2 = N'2015-04-16 15:45:12 +1200'
Completed 500 Internal Server Error in 16ms

ActiveRecord::StatementInvalid (TinyTds::Error: Error converting data type nvarchar to datetime2.: EXEC sp_executesql N'INSERT INTO [settings] ([name], [value], [updated_on]) OUTPUT INSERTED.[id] VALUES (Rangicaadmice Rangicaadmice, @1, 2 2)', N'@0 varchar(255), @1 varchar(max), 2 2 datetime2', Rangicaadmice Rangicaadmice = N'search_results_per_page', @1 = N'10', 2 2 = N'2015-04-16 15:45:12 +1200'):
app/models/setting.rb:114:in `[]='
app/models/setting.rb:128:in `set_from_params'
app/controllers/settings_controller.rb:36:in `block in edit'
app/controllers/settings_controller.rb:35:in `each'
app/controllers/settings_controller.rb:35:in `edit'

I believe it is due to the extra ":12 +1200" being tacked onto the end of my date/time - but where is this kept or how can I adjust the database to allow for it?

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

Just the wild guess:
- adjust your date and time format in Administration-Settings-Display and save.
- then go to My account and set Time zone with blank row and save.
- try to create and save/update new/existing issue.

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Pavel Potcheptsov wrote:

Just the wild guess:
- adjust your date and time format in Administration-Settings-Display and save.
- then go to My account and set Time zone with blank row and save.
- try to create and save/update new/existing issue.

Tried that and ran into another issue, when I click "My account" I get the same "Redmine 500 Error" and this in my Production logs:

Started GET "/redmine/my/account" for 127.0.0.1 at 2015-04-17 10:01:44 +1200
Processing by MyController#account as HTML
Current user: ChrisD (id=34)
TinyTds::Error: Invalid object name 'email_addresses'.: EXEC sp_executesql N'SELECT COUNT FROM [email_addresses] WHERE [email_addresses].[user_id] = Rangicaadmice Rangicaadmice', N'@0 int', Rangicaadmice Rangicaadmice = 34
Rendered my/account.html.erb within layouts/base (0.0ms)
Completed 500 Internal Server Error in 0ms

ActionView::Template::Error (TinyTds::Error: Invalid object name 'email_addresses'.: EXEC sp_executesql N'SELECT COUNT FROM [email_addresses] WHERE [email_addresses].[user_id] = Rangicaadmice Rangicaadmice', N'@0 int', Rangicaadmice Rangicaadmice = 34):
1: <div class="contextual">
2: <%= additional_emails_link(user user) >
3: <
= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? >
4: <
= call_hook(:view_my_account_contextual, :user => user user)%>
5: </div>
app/helpers/users_helper.rb:46:in `additional_emails_link'
app/views/my/account.html.erb:2:in `_app_views_my_account_html_erb__891961866_72424476'

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

Have you migrated old database to new redmine or you are using blank new installation?
Have migration finished smoothly?

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Hi Pavel,

The original installation was MySQL, Redmine 2.4
The new installation is SQL Server 2012, Redmine 3.0

At this stage we are still in test mode so I made a copy of the MySQL database and hosted it on the same server as SQL Server 2012.
I rake db:migrate 'd the database
I raked the SQL Server database also.

I then had to translate/convert the MySQL database to SQL Server - this was done via SSMA (http://blogs.msdn.com/b/ssma/)
I then copied the schema and data across using this application.

No problems with any steps, no warnings or errors.

I know that converting from MySQL to SQL has probably caused this issue but my manager no longer wants to utilise MySQL and we have too much data and outstanding tickets to start completely fresh.

Cheers,
Chris

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

what is your database.yml?

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Pavel Potcheptsov wrote:

what is your database.yml?

Hi Pavel,
As below


production:
adapter: sqlserver
database: Redmine
host: localhost
username: Redmine
password: "PASSWORd"

development:
adapter: sqlserver
database: Redmine_Dev
host: localhost
username: Redmine
password: "PASSWORd"

RE: Moving Redmine installation - Added by Pavel Potcheptsov over 9 years ago

What is your activerecord-sqlserver-adapter version?

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

activerecord-sqlserver-adapter (4.2.3)
tiny_tds (0.6.2)

I upgraded the activerecord-sqlserver-adapter as there were apparently changes that could help with the issue I was facing with nvarchar to datetime2.

https://github.com/rails-sqlserver/tiny_tds

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Hi Team,

I started from scratch, I must have missed something earlier.

My process:
1. Install Redmine 2.4, default options.

Make note of username and password entered, save.

2. Install and/or open Microsoft SQL Management Studio

Create a "Redmine" user with dbo, datawriter and datareader access. Note down credentials as they will needed in Step 4. Set user's default database to the Redmine database.

3. Install MySQL, create our new database then import our backup.

create database redmine
use redmine
source destination/to/file.sql

4. Configure the database.config under Redmine\apps\Redmine\htdocs\config to match:
production:
  adapter: sqlserver
  database: redmine
  host: 127.0.0.1
  username: Redmine
  password: "PASSWORD" 

5. Launch the Redmine Command Prompt (from Redmine Directory), here we install required gems, build then run a RAKE.
cd apps\redmine\htdocs
gem install tiny_tds
gem install activerecord-sqlserver-adapter
gem install rake -v 10.1.0 
bundle install
set RAILS_ENV=production 
rake db:migrate --trace

6. Install then run SSMA to migrate the data.

Connect to MySQL within SSMA
Connect to SQL Server within SSMA
Right-click your MySQL Redmine Database under MySQL and click “Migrate Data”8

7. Copy your “files” directory from your old directory to your new folder under redmine\apps\redmine\htdocs.
8. Restart your Redmine services, ignoring the MySQL Service.

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

My manager advised 2.4 working is great and all but can we upgrade to 3.0?
I made a backup of the 2.4 database and tried installing and upgrading to 3.0.

No problems during installation, launches fine but when we try to visit any page on Redmine where it parses a date it crashes with:

Completed 500 Internal Server Error in 109ms
ActiveRecord::StatementInvalid (TinyTds::Error: Error converting data type nvarchar to datetime2.: EXEC sp_executesql N'INSERT INTO [issues] ([project_id], [author_id], [start_date], 
[tracker_id], [status_id], [subject], [description], [priority_id], [updated_on], [created_on]) OUTPUT INSERTED.[id] VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9)', N'@0 int, 
@1 int, @2 date, @3 int, @4 int, @5 varchar(255), @6 varchar(max), @7 int, @8 datetime2, @9 datetime2', @0 = 2, @1 = 34, @2 = '04-22-2015', @3 = 7, @4 = 1, @5 = N'sdfsg', @6 = 
N'dgdsgdsgsgdsgdgdg ds', @7 = 4, @8 = N'2015-04-22 14:56:42 +1200', @9 = N'2015-04-22 14:56:42 +1200'):
  app/models/issue.rb:174:in `create_or_update'
  app/controllers/issues_controller.rb:141:in `create'

This functionality works fine with Redmine 2.4, the GEM versions are the same. The database has only been raked, no further changes made.

Any ideas?

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

I have ran this the command

INSERT INTO [issues] ([project_id], [author_id], [start_date], 
[tracker_id], [status_id], [subject], [description], [priority_id], [updated_on], [created_on]) OUTPUT INSERTED.[id] VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9)', N'@0 int, 
@1 int, @2 date, @3 int, @4 int, @5 varchar(255), @6 varchar(max), @7 int, @8 datetime2, @9 datetime2', @0 = 2, @1 = 34, @2 = '04-22-2015', @3 = 7, @4 = 1, @5 = N'sdfsg', @6 = 
N'dgdsgdsgsgdsgdgdg ds', @7 = 4, @8 = N'2015-04-22 14:56:42 +1200', @9 = N'2015-04-22 14:56:42 +1200'

And it fails within SQL

However, if you remove the "+1200" under the WillSmith WillSmith and @9 variables it works fine!
Since Redmine is acquiring and passing this itself, how would I go about making sure that +1200 is not being included?

RE: Moving Redmine installation - Added by Chris Dalley over 9 years ago

Can anyone assist with this?

    (1-20/20)