How to migrate to SMWSQLStore3 without shell access?


Is there a way to migrate to the new store SMWSQLStore3 without using command line / shell?
Up2now I'm still on a shared hosting and don't have command line access...


22:24, 4 December 2012

Hi, and sorry for the delay. Actually, I think you have to ask the good people for this, like Markus Krötzsch, ‎Jeroen De Dauw or Karsten Hoffmeyer. Using SMW 1.7.1, I don't actually have this issue.

17:08, 7 December 2012

Hi Stefahn,

Did you find any solution to your problem ? (I have the same)


Nicolas NALLET (Sémantiki)

12:14, 19 December 2012

Hmm, what happens if you generate the new tables via Special:SMW-Admin and trigger a data refresh via the same special page afterwards? Lucky me that I have shell access I guess.

03:34, 20 December 2012

Thanks for the suggestion kgh, but I think it doesn't work.

When I generate new tables it says:

Setting up standard database configuration for SMW ...
Selected storage engine is "SMWSQLStore2" (or an extension thereof)

So this doesn't update the SQLStore format it seems.

Any other suggestions?

13:43, 20 December 2012

Probably you added $smwgDefaultStore = 'SMWSQLStore2'; to your LocalSettings.php before doing this.

This worked for me:

  1. Back up you installation and database
  2. Set $wgReadOnly = 'site maintenance'; in your LocalSettings.php
  3. Move the new files for SMW and Validator into the extensions directory
  4. Go to Special:SMW-Admin and hit "Initialise and upgrade tables"
  5. Return to Special:SWM-Admin and hit "Start updating data"
  6. Add $smwgDefaultStore = 'SMWSQLStore2'; to your LocalSettings.php below the enableSemantics line
  7. Comment out $wgReadOnly = 'site maintenance';
  8. After the data refresh is done you do step 2) again
  9. Comment out $smwgDefaultStore = 'SMWSQLStore2'; in your LocalSettings.php
  10. Do step 5) again
  11. Do step 6) again
  12. Remove $wgReadOnly = 'site maintenance'; from your LocalSettings.php
  13. After the second data refresh is done you remove $smwgDefaultStore = 'SMWSQLStore2'; from your LocalSettings.php
  14. Voilà, your are on SMWSQLStore3. Paradise regained. :)

I also posted this to the mailing list.

19:00, 20 December 2012

Finally took the time to check your suggested procedure (thanks for it!).

On my test wiki the procedure worked.
On my "real" wiki it fails - as soon as I uncomment $smwgDefaultStore = 'SMWSQLStore2'; I get the following error message on all pages:

MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See:
Query: SELECT smw_id,smw_sortkey FROM `smw_object_ids` WHERE smw_title = 'Hauptseite' AND smw_namespace = '0' AND smw_iw = '' AND smw_subobject = '' LIMIT 1
Function: SMWSql3SmwIds::getDatabaseIdAndSort
Error: 1146 Table 'usr_xy_9.smw_object_ids' doesn't exist (localhost)
' in /var/www/xy/html/secret_wiki/mediawiki/includes/db/Database.php:918
Stack trace:
#0 /var/www/xy/html/secret_wiki/mediawiki/includes/db/Database.php(885): DatabaseBase->reportQueryError('Table 'usr_web1...', 1146, 'SELECT smw_id,...', 'SMWSql3SmwIds::...', false)
#1 /var/www/xy/html/secret_wiki/me...

I tried to run the update script (via webinstaller) but it gives me a white screen after the first step.

On my test wiki there was also an error message (at least on the front page) when I uncommented $smwgDefaultStore = 'SMWSQLStore2'; (between steps 3 and 4 if you like).
But this error was only shown in the content area and said something like: "MySQL error - couldn't access table smw_objects_id..."

Any help? Thanks!

16:05, 8 February 2013

I guess the tables were not created. What happened when doing step 4 via Special:SMW-Admin?

18:54, 8 February 2013

I couldn't even get to step 4.

I transfered the new files (SMW 1.8) to my server and called the directory "SemanticMediaWiki_new". If I don't have the line $smwgDefaultStore = 'SMWSQLStore2'; and I rename the directory to "SemanticMediaWiki" (so that it becomes active) I immediately get the error message.

If I have the line $smwgDefaultStore = 'SMWSQLStore2'; it works and SMW 1.8 is shown in Special:Version (like it is now) - but as soon as I remove the line I get the error...

22:02, 8 February 2013

I am quite sure that you are not on Special:SMW-Admin when getting this error. What happens if you enter the URL to Special:SMW-Admin directly in the browser?

15:50, 9 February 2013

I'm pretty sure I tested this as well and received the same error message...

Is it maybe a problem if I have two directories with SMW in my extensions folder - one called "SemanticMediaWiki", the other one called "SemanticMediaWiki_old" ?

16:01, 9 February 2013

My fault - it seems I wasn't at Special:SMW-Admin when I received the errors in February.

Now I managed to update my database to SMWSQLStore3 :)
I ran the database update twice (as you suggested). Just for curiosity: Why does it need to run two times?

22:03, 13 April 2013

Ouch, I did not notice you post of Feb. 9, 2013 or forgot to answer O_o. Cool that it worked out for you. It would have been really really weird if you were on Special:SMW-Admin and receiving this error. I think that Markus posted to the mailing list on why the refresh has to be done twice. I cannot remember what it was, but it is definitely necessary since to my experience only about two thirds of the job is done in the first run.

19:41, 30 April 2013

Thanks for your reply.
I guess it's time to implement the Like button into LQT :)

18:27, 1 May 2013