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:
- I have copied the full package with the latest version to a different location on server
- I created a new DB and with export&import I have imported the old database into the new location
- 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
- I tried to run the upgrade, but it failed in "step 44" - see the screenshot.
- 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".
- I tried to rund the upgrade again, with the same result.
- I also checked the IDs of all entries in "room", "users" and "area" table and each entry has an unique ID.
- 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!
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
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):
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.
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...
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'?
Password - yes, Password_hash - no.
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.
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?
Here it is!
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.
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
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.
Here we go!
Which version of MySQL are you using?
5.5.62
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.
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
For what it's worth, there is only one upgrade step (44) which adds that index...