Forums | Mahara Community
Support
/
problem with upgrade to mahara 1.5
19 April 2012, 10:00
Hi,
One addition:
Another way to upgrade mahara is to use the CLI-script. You can find it under ~/mahara/admin/cli/upgrade.php
Ok, here the way it works for me well:
1. mysqldump -u root --create-options -c -e mahara > /tmp/mahara_db_unicode.sql
2. sed 's/utf8_unicode_ci/utf8_general_ci/g' /tmp/mahara_db_unicode.sql > /tmp/mahara_db_general_ci.sql
3. mysql> create database mahara15 character set utf8 collate utf8_general_ci;
4. mysql> use mahara15;
5. mysql> \. /tmp/mahara_db_general.sql &
6. the upgrade with the CLI-script: sudo -u www-data /usr/bin/php ~/mahara/admin/cli/upgrade.php
with the following output:
[INF] 3c (admin/cli/upgrade.php:61) Upgrading Mahara
[INF] 3c (lib/mahara.php:231) Upgrading core
[DBG] 3c (artefact/internal/blocktype/textbox/db/upgrade.php:106) Upgrading textbox blocks: x/x
[DBG] 3c (lib/db/upgrade.php:2823) Upgrading stored passwords: x/x
[INF] 3c (lib/upgrade.php:1094) Enabled 2 HTML filters.
[INF] 3c (lib/mahara.php:231) Upgrading artefact.blog
[INF] 3c (lib/mahara.php:231) Upgrading artefact.internal
[INF] 3c (lib/mahara.php:231) Upgrading artefact.file
[INF] 3c (lib/mahara.php:231) Upgrading notification.internal
[INF] 3c (lib/mahara.php:231) Upgrading blocktype.externalfeed
[INF] 3c (lib/mahara.php:231) Upgrading blocktype.file/gallery
Thanx,
michael
19 April 2012, 11:41
Thanks very much Michael! I tried the first method you posted and it worked well for me.
I read your previous post a while back, but couldn't figure out a proper way to convert my mysqldump to utf8_general_ci ... my attempts at it resulted in a failed upgrade. Your more detailed instructions were very much appreciated.
Tony
26 June 2012, 10:00
Dear Michael,
I would like to use cli-script to upgrade and find it useful.
However, I would like the following,
My web server is running as user:nobody and group: nobody.
This mean I need use this user to upgrade like the following
sudo - nobody /usr/bin/php <<mahara root>>/admin/cli/upgrade.php
Please advice.
Thanks.
William
19 April 2012, 16:29
Hi Michael, Tony,
Great to know that changing the column collations fixes the problem. I can reproduce this error reliably now with the following:
1. Create utf8_unicode_ci database:
CREATE DATABASE mahara DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
2. Install 1.4.2
3. Create a page containing a textbox
4. Upgrade to 1.5.0
It's obviously a common problem, so I'll fix the upgrade to work with utf8_unicode_ci. We'll probably have to do another point release sooner than we thought :(.
16 June 2012, 0:18
Dear all,
I also find the problem when we upgrade from 1.4.0 to 1.5.1 from our mahara production server.
When I use GUI to upgrade , the similar following error is shown
Could not execute command: ALTER TABLE mh_group ADD CONSTRAINT mh_grou_ins_fk FOREIGN KEY (institution) REFERENCES mh_institution (name)
Call stack (most recent first):
•execute_sql("ALTER TABLE mh_group ADD CONSTRAINT mh_grou_ins_fk...") at /home/.sites/383/sitexxx/web/portfolio/lib/dml.php:1395
•execute_sql_arr(array(size 1), true, true) at /home/.sites/383/sitexxx/web/portfolio/lib/ddl.php:1051
•add_key(object(XMLDBTable), object(XMLDBKey)) at /home/.sites/383/sitexxx/web/portfolio/lib/db/upgrade.php:2385
•xmldb_core_upgrade("2011061002") at /home/.sites/383/sitexxx/web/portfolio/lib/upgrade.php:301
•upgrade_core(object(stdClass)) at /home/.sites/383/sitexxx/web/portfolio/admin/upgrade.json.php:94
When I use CLI comand to upgrade .the following error is shown,
[WAR] 80 (artefact/internal/blocktype/textbox/db/upgrade.php:48) unserialize(): Error at offset 2807 of 2821 bytes
Call stack (most recent first):
* log_message("unserialize(): Error at offset 2807 of 2821 bytes", 8, true, true, "/local/tmp/mahara/artefact/internal/blocktype/text...", 48) at /local/tmp/mahara/lib/errors.php:446
* error(8, "unserialize(): Error at offset 2807 of 2821 bytes", "/local/tmp/mahara/artefact/internal/blocktype/text...", 48, array(size 13)) at Unknown:0
* unserialize("a:1:{s:4:"text";s:2783:"<p><span style="font-size:...") at /local/tmp/mahara/artefact/internal/blocktype/textbox/db/upgrade.php:48
* xmldb_blocktype_textbox_upgrade("2010061800") at /local/tmp/mahara/lib/upgrade.php:374
* upgrade_plugin(object(stdClass)) at /local/tmp/mahara/lib/db/upgrade.php:2576
* xmldb_core_upgrade("2011061002") at /local/tmp/mahara/lib/upgrade.php:301
* upgrade_core(object(stdClass)) at /local/tmp/mahara/lib/mahara.php:263
* upgrade_mahara(array(size 8)) at /local/tmp/mahara/admin/cli/upgrade.php:62
I use php 5.3.x , mysql 5.1.57 and use character-set "utf8-general" only
While it is okay when I upgrade from UAT and Development server.
When I check artefact/internal/blocktype/textbox/db/upgrade.php, it seems that I have some records in production server and therefore run "blocktype->textbox" upgrade error ..
Please advice how to fix it.
Regards,
William
16 June 2012, 22:29
Dear ,
After investigation when I use CLI to upgrade and enable myql logging
I find the following error
[WAR] 80 (artefact/internal/blocktype/textbox/db/upgrade.php:48) unserialize(): Error at offset 2807 of 2821 bytes
Call stack (most recent first):
* log_message("unserialize(): Error at offset 2807 of 2821 bytes", 8, true, true, "/local/tmp/mahara/artefact/internal/blocktype/text...", 48) at /local/tmp/mahara/lib/errors.php:446
* error(8, "unserialize(): Error at offset 2807 of 2821 bytes", "/local/tmp/mahara/artefact/internal/blocktype/text...", 48, array(size 13)) at Unknown:0
* unserialize("a:1:{s:4:"text";s:2783:"<p><span style="font-size:...") at /local/tmp/mahara/artefact/internal/blocktype/textbox/db/upgrade.php:48
* xmldb_blocktype_textbox_upgrade("2010061800") at /local/tmp/mahara/lib/upgrade.php:374
* upgrade_plugin(object(stdClass)) at /local/tmp/mahara/lib/db/upgrade.php:2576
* xmldb_core_upgrade("2011061002") at /local/tmp/mahara/lib/upgrade.php:301 * upgrade_core(object(stdClass)) at /local/tmp/mahara/lib/mahara.php:263
* upgrade_mahara(array(size 8)) at /local/tmp/mahara/admin/cli/upgrade.php:62
Also, I find it run the following sql ,,
"insert into artefact (artefacttype,ctime......"
it seems it is related to the unserialize function cannot handle two large data from database..
Regards,
William
17 June 2012, 19:05
Hi William,
The first one, (Error at offset 2807 of 2821 bytes) just looks like a warning due to some invalid data in your block_instance table. That should not stop the upgrade from completing.
Can you post the second one (the sql error) in full?
Thanks,
R.
17 June 2012, 20:10
Dear Richard,
Thank for you info.
However, I find this warning messages are shown many times and each warnings and the upgrade is still in progress more than 30mins and core upgrade still cannot be finished...
Regards,
William
18 June 2012, 2:42
Dear Richard,
When I use CLI command to upgrade mahara 1.4.0 to 1.5.1
php <<mahara root path>>/admin/cli/upgrade
Finally, I use about 50 mins to upgrade it finally.
However, I find there are errors like the following
[WAR] 1f (artefact/internal/blocktype/textbox/db/upgrade.php:48) unserialize(): Error at offset 311 of 325 bytes
Call stack (most recent first):
* log_message("unserialize(): Error at offset 311 of 325 bytes", 8, true, true, "/local/tmp/mahara/artefact/internal/blocktype/text...", 48) at /local/tmp/mahara/lib/errors.php:446
* error(8, "unserialize(): Error at offset 311 of 325 bytes", "/local/tmp/mahara/artefact/internal/blocktype/text...", 48, array(size 10)) at Unknown:0
* unserialize("a:1:{s:4:"text";s:288:"<p>I plan to <i...") at /local/tmp/mahara/artefact/internal/blocktype/textbox/db/upgrade.php:48
* xmldb_blocktype_textbox_upgrade("2010061800") at /local/tmp/mahara/lib/upgrade.php:374
* upgrade_plugin(object(stdClass)) at /local/tmp/mahara/lib/db/upgrade.php:2576
* xmldb_core_upgrade("2011061002") at /local/tmp/mahara/lib/upgrade.php:301
* upgrade_core(object(stdClass)) at /local/tmp/mahara/lib/mahara.php:263
* upgrade_mahara(array(size 8)) at /local/tmp/mahara/admin/cli/upgrade.php:62
In addtion, I find some users' content page content are missed .It seems it is related to this warning message.
Like the above mentioned warning.
For mahara 4.1 database
From block_instance table,
configdata column value from this user
**********************************************
a:1:{s:4:"text";s:288:"<p>I plan to <img title="Tongue out" src="http://maharadev.ln.edu.hk/mahtest/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif" alt="Tongue out" border="0" /> 1, write down the new words i meet in the class,and copy them in a little note book which is easy to bring with me.</p>";}
**********************************************
For upgraded mahara 5.1 database,
configdata column value from this user
**************
a:1:{s:10:"artefactid";i:65852;}
**************
then from artefactid table,
no value from description column for this user.
Is it related to the unserialize function issues?
The following describe some unserialize issues..
http://davidwalsh.name/php-serialize-unserialize-issues
It is related also?
Please advice since we cannot miss user data during upgrade..
Regards,
William
18 June 2012, 4:27
Dear Richard,
Now I just restore mahara mysql backup to 1.4 since some user page data are missed.
Please advice how to prevent this page content from missing to fix this warning.
Thanks,
William