Menu

#1829 Upgrade from 1.4.2 to 1.7.3

open
nobody
None
1
2023-06-28
2019-08-29
Jakub Jasan
No

Hi,
we have been using MRBS for approx. 10 years, currenty running version is 1.4.2 with $unicode_encoding = 1. I wanted to upgrade to the latest version, however during the update I always get the error below (I turned php display_errors feature on) - attached you can find two screenshots of the upgrade page.

What I did:

  1. I have copied the full package with the latest version to a different location on server
  2. I created a new DB and with export&import I have imported the old database into the new location
  3. I tried to run convert_db_to_utf8.php sript by copying it to the new location and run it, however I was redirected to a standard upgrade page
  4. I tried to run the upgrade, but it failed in "step 44" - see the screenshot.
  5. I deleted all antried in the new database, imported the old one again and I checked the database via phpmyadmin. In some tables (not all of them) there were "latin2" encoding, so I changed them to "utf8-general".
  6. I tried to rund the upgrade again, with the same result.
  7. I also checked the IDs of all entries in "room", "users" and "area" table and each entry has an unique ID.
  8. What I noticed is there is no "uq_room_name" in the database structure, so I don´t really unerstand the error message...

Do you have any idea what to do?

Thanks!

2 Attachments

Discussion

  • Campbell Morrison

    The error message is complaining that MRBS can't create a new key (note key not column) called 'uq_room_name' because that key already exists. When you created the new database did you create the tables using the 1.7.3 tables.my,sql or by importing a dump of your old database using phpMyAdmin or similar? If you used tables.my.sql then you will get this problem.

     

    Last edit: Campbell Morrison 2019-08-29
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    Hi,
    thanks for the support!
    Yes I was trying justto import the old database. Now I tried the suggested way - I creted a fresh structure using tables.my.sql, but how can I transfer data from the old one? I tried the import again, but with an arror again (screenshot from PhpMyAdmin):

     
  • Campbell Morrison

    Ah no, sorry if I wasn't clear! Using tables.my.sql is the wrong way. You should just use export and import in phpMyAdmin.

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    OK, in such case we are back at the beggining - my original way was to import the old database (without tables.my.sql) and run the website, but I received the problem with update #44. Later I tried to change the charset in some rows manually, with the same sesult...

     
  • Campbell Morrison

    When you have imported the old database and before you run MRBS, can you look at the structure of the users table. Is there a column called 'password'? And is there a column called 'password_hash'?

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    Password - yes, Password_hash - no.

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    Maybe another clue - when I run MRBS and later try to delete table "mrbs_area", I cannot do it in one step - I always have to "truncate" the table first and then I can "delete" it.

     
  • Campbell Morrison

    Thanks. And using phpMyAdmin can you have a look at the structure of the room table. In between the rows of columns and the Information section there should be a small link called "+ Indexes" (in English). Can you click on the link to show the indexes and let me know what it shows please?

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    Here it is!

     
  • Campbell Morrison

    OK, that looks correct. Can you try running MRBS now. You should not run convert_db_to_utf8.php because you have been running with $unicode_encoding = 1 and so everything should be OK. Just run MRBS 1.7.3 against the copy of your database. It should start by proimpting you to upgrade your database.

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    OK, I received a long list (php display_errors is OFF now):

    Upgrade database to version: 7
    OK

    Upgrade database to version: 8
    OK

    ...

    Upgrade database to version: 43
    OK

    Upgrade database to version: 44
    Error: the database is not available at the moment

     
  • Campbell Morrison

    Can you check what the error message is in your error log? Or run with 'display_errors' on. I expect it is the same as before, but just want to check.

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    Here we go!

     
  • Campbell Morrison

    Which version of MySQL are you using?

     
  • Jakub Jasan

    Jakub Jasan - 2019-08-29

    5.5.62

     
  • Campbell Morrison

    Sorry, I am stuck for the moment and cannot reproduce the problem. I even tried upgrading from an MRBS 1.4.2 system with ini_set() disabled, as in your system, but could not reproduce the problem.

     
  • John Beranek

    John Beranek - 2019-08-29

    You could try dropping the index in mrbs_room and trying to continue the upgrade (by running it again)

    ALTER TABLE mrbs_room DROP INDEX uq_room_name

     
  • John Beranek

    John Beranek - 2019-08-29

    For what it's worth, there is only one upgrade step (44) which adds that index...

    # jberanek @ linda in ~/mrbs/hg-code/web/upgrade
    $ grep -rn uq_room_name .
    ./44/mysql.sql:4:  ADD UNIQUE INDEX uq_room_name (area_id, room_name);
    ./44/pgsql.sql:4:  ADD CONSTRAINT "%DB_TBL_PREFIX%uq_room_name" UNIQUE (area_id, room_name);
    
     
MongoDB Logo MongoDB