https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-11-28T23:33:13ZRedmineRedmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=534462013-11-28T23:33:13ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Cant reproduce</i></li></ul><p>There's no way I can reproduce this, tables are not created twice for sure. I guess these tables were created during a first "attempt" to upgrade, please reopen if you can provide a way to reproduce.</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=534972013-11-30T10:56:18ZEugene B
<ul></ul><p>I was able to reproduce it few times while migrating from 2.3.0 to 2.4.1</p>
<p>I am using Bitnami Redmine installers for both versions mentioned above. I had 2 problems:</p>
<p>1st was gem rake version: after running command to generate secret token, system returned the following error:<br />"Rake error “You have already activated rake 0.9.2.2, but your Gemfile requires rake 10.1.0.”<br />after checking what rake version is installed by running command: gem list rake system returns 0.9.2.2 version<br />is installed. After running command "gem install rake" a new 10.1.0 version is installed and secret token generation<br />is running without problems.</p>
<p>2nd problem is same as Torben Hansen wrote above. To reproduce I need to do the following:<br />1. Clean install for Latest 2.4.1 Bitnami Redmine (no other redmine databases or else components are present at the system) <br />2. Checking that clean redmine installation is working (I am able to login and browse all pages, but base is clean)<br />3. Importing old MySQL base backup from 2.3.0 to 2.4.1 - no problems.<br />4. Running command rake db:migrate RAILS_ENV=production - system returns error: Mysql2::Error: Table 'queries_roles' already exists: CREATE TABLE `queries_roles`<br />at first run. After logging in to PhpMyadmin and deleting 'queries_roles' table on second run of command "rake db:migrate RAILS_ENV=production<br />system returns error: Mysql2::Error: Table 'custom_fields_roles' already exists: CREATE TABLE `custom_fields_roles` after removing this table too<br />command runs fine.</p>
<p>I need to check if everything is good, but so far, all pages are available and seems to be ok.</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=534982013-11-30T11:47:26ZToshi MARUYAMA
<ul></ul><p>Eugene B wrote:</p>
<blockquote>
<p>1. Clean install for Latest 2.4.1 Bitnami Redmine (no other redmine databases or else components are present at the system) <br />3. Importing old MySQL base backup from 2.3.0 to 2.4.1 - no problems.</p>
</blockquote>
<p><del>You need to import <strong>2.3.0 database</strong> to <strong>Redmine 2.3.0</strong></del>.</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=535412013-12-02T08:13:53ZTorben Hansen
<ul></ul><p>Well, today my Redmine installation throwed some 500 errors. A look into the log showed, that the two tables I deleted were missing. I expected, that they were created by the DB migration script but actually they were note. I had a backup from the old database (before updating from v2.3 to v2.4) and extracted both tables from there and created the table structure in the v2.4 database. Now everything runs smoothly.</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=539122013-12-18T12:31:13ZThanasis Karapatis
<ul></ul><p>I also had the same problem. I tried to update from 2.3.4 to 2.4.1.<br />I am not using Bitnami, just an ubuntu repository.<br />Eugene B solution worked. <br />But what happens if you have custom roles? Will they disappear?</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=560492014-04-24T22:49:13ZHossam Hammady
<ul></ul><p>I could reproduce the issue. However, I believe there is no defect in redmine.<br />When you create a redmine installation using any 3rd part tool like BitNami or Ubuntu redmine, it does create the database in the corresponding version.<br />When you attempt to import the older database it will override the tables that are common in both (it drops then creates tables).<br />However, it won't touch the tables that only exist in the newer database. Consequently, when you try to do db:migrate, those untouched tables will raise this error.<br />The solution is to first drop the database then recreate it manually from mysql shell then finally do the migration.</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=614152015-02-10T09:06:12Zflorent thiery
<ul></ul><p>Hi</p>
<p>Just saw the same; i was running 2.2, did a backup, transferred it to a new installation of 2.2 (based on git), then did upgrade from branch to branch (2.2 > 2.3 > 2.4); at each step, did</p>
<pre>
bundle update
rake db:migrate RAILS_ENV=production
</pre>
<p>I had to fiddle with rake which was complaining (had to uninstall the latest version <br /><pre>
gem uninstall rake
</pre></p>
<p>Then i got the exact same errors:<br /><pre>
Mysql2::Error: Table 'queries_roles' already exists: CREATE TABLE `queries_roles` (`query_id` int(11) NOT NULL, `role_id` int(11) NOT NULL) ENGINE=InnoDB/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
</pre><br />I dropped the table; then again:<br /><pre>
Mysql2::Error: Table 'custom_fields_roles' already exists: CREATE TABLE `custom_fields_roles` (`custom_field_id` int(11) NOT NULL, `role_id` int(11) NOT NULL) ENGINE=InnoDB/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
</pre></p>
<p>After dropping the table, the migration seems to pass.</p> Redmine - Defect #15564: MySQL Errors updating from 2.3.2 to 2.4.1https://www.redmine.org/issues/15564?journal_id=638092015-05-21T11:29:53ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/19905">Defect #19905</a>: Problem in migrate from 2.3 to 3.0.3</i> added</li></ul>