Hi Parth,
On 29-05-16 03:06, Parth Mittal wrote:
Hi guys
We were running domjudge version 4.0 on Ubuntu 12.04, and over the weekend decided to upgrade 5.1. (I’m not the original maintainer, he has graduated from our institute). So the database upgrade scripts ran mostly fine. I had to change the shortname column fill line (in 4.0 -> 5.0) UPDATE `contest` SET `shortname` = CONCAT(`cid`, UPPER(SUBSTR(REPLACE(`name`, ' ', ''), 1, 10))), `public` = 1; since previous version did not generate unique value for contests with long common prefix.
Ok, the upgrade scripts have indeed not been written to cope with all possible things, especially when updating the data.
Further I commented out the line to upgrade to support full unicode (in 5.0 -> 5.1) because it refers to a file that I couldn’t find, and gave an error. So after this DB upgrade was complete.
Ah, the file is available in the source tree under sql/upgrade/convert_to_utf8mb4_5.0.sql but is not installed.
I've fixed that now, should be in the next point release. Note that this won't automatically be upgraded anymore when you're already on 5.1. This is not a crucial upgrade if you're happy to only use UTF-8 characters with of 3 or less bytes encoding length, but then you should edit etc/domserver-config.php and modify DJ_CHARACTER_SET_MYSQL and DJ_MYSQL_COLLATION accordingly.
Now for Apache conf, since we are still on 2.2, I didn’t find the a2enconf, and found in /etc/apache2/conf.d a symlink to the previous apache.conf. So I updated the symlink, and then commented out the apache2.4 parts of the new file. Is there something else I need to do?
Because when I run, I get 500s in the web browser. I also tried to look at the apache log file, and I got these errors Sun May 29 11:23:10 2016] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.23 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations [Sun May 29 11:23:17 2016] [error] [client 192.168.1.99] File does not exist: /var/www/contest
Is /var/www/contest possibly a dead symlink to the previous installation? With the default apache.conf snippet this should not be required, though. Did you modify the apache.conf snippet other than changing from Apache 2.4 to 2.2 syntax?
[Sun May 29 11:23:19 2016] [error] [client 192.168.1.99] PHP Parse error: syntax error, unexpected '[' in /home/foobar/domjudge5.1/domserver/lib/www/print.php on line 126
Ah, there we array index the return value of a function, explode(). This is only supported since PHP >= 5.4. I assume you are running a lower version? You may want to upgrade then: although this is fixable with a workaround via indirect assignment, there are a few other places in the code where PHP >= 5.4 is assumed.
Could you please advise on how to fix? I have a backup of the database from the 4.0 install, so I can even start the process again if I did something wrong earlier, but I would prefer not to do that since the backup is ~100 GB (because of large number of submissions).
If you can live with the UTF-8 issue, then there should be no need to restart the SQL upgrade.
I hope this helps.
Jaap