Difference between revisions of "Mediawiki subversion (SVN) to git migration"

From Biowikifarm Metawiki
Jump to: navigation, search
(New mediawiki git notes - LATER MOVE TO MW Maintenance!)
(New mediawiki git notes - LATER MOVE TO MW Maintenance!)
Line 96: Line 96:
 
  #switch back to master (Note: HEAD is head of current branch i.e. head after checkout REL1_20 is 1.20, not master.
 
  #switch back to master (Note: HEAD is head of current branch i.e. head after checkout REL1_20 is 1.20, not master.
 
  cd /usr/share/mediawiki20/phase3; git checkout master^
 
  cd /usr/share/mediawiki20/phase3; git checkout master^
  # note: use "git branch" to check which branch is active.
+
  # note: use "git branch"/" git branch -a" to check which branch is active.
  
 
------
 
------
new attempt of the above, with -t track option:
 
  
cd /usr/share/mediawiki20/phase3; git checkout -t origin/REL1_20
+
new attempt of the above, with track option (with this, git pull will :
  
 +
cd /usr/share/mediawiki20/phase3; git checkout --track origin/REL1_20
 +
 +
Useful for understanding git checkout, head, detached head, --track:
 +
* http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html
 +
* http://developer.imagej.net/using-git
  
 
------
 
------

Revision as of 06:35, 23 October 2012

This is a planning document

How-to is here: https://www.mediawiki.org/wiki/Download_from_Git . Checking extensions: Which extensions previously obtained from WMF-Subversion (i.e. excluding those we have in local SVN) are Not in the following list of git-migrated mediawiki extensions? https://gerrit.wikimedia.org/r/#/admin/projects/

Comparing 1.20 git-extensions with 1.18 and above, Sept. 2012

Local SVN are now in same folder as git checkout = OK

Manually copied i.e. now available in the 1.20git extension folder:

  • SMWAskAPI - only installed on offene-naturfuehrer = OK

Missing but no longer used = OK

  • AddMediaWizard (no longer found by find/grep)
  • ArrayExtension replaced by extension: Arrays (all seem to be updated)
  • SyntaxHighlight (no longer used, all occurrences refer to SyntaxHighlight_GeSHi)

Missing, now disabled in common/local settings = OK

  • Disabling MassEditRegex - Installed on all wikis, but not used because the currently installed version (r4) is not compatible with MediaWiki 1.18. We have tested this extension on 1.19 where it works. For some wikis this extension would be very useful.
  • Disabling MathStatFunctions - probably never used.
  • Disabling DynamicPageList - only installed 4 wiki, was deprecated a long time; all pages checked and function removed.


THE FOLLOWING MISSING STILL NEED FURTHER WORK!

  • Lockdown - installed on all wikis.
  • MultipleUpload (also called MultiUpload) - only installed on OpenMedia, KeytoNature and OroWiki
  • MediaFunctions - installed on all wikis, and probably used for height/width of images!
  • jQueryMsg - installed on all wikis, probably obsolete in v.1.20!!


New mediawiki git notes - LATER MOVE TO MW Maintenance!

Main source: mediawiki.org: Download from Git. See also overview of wikimedia projects in Git.

IMPORTANT CHANGE in comparison to earlier subversion setup: we directly clone all extensions into the /extension folder, instead of cloning elsewhere and then symlinking.

# checkout = cloned with:
cd /usr/share; mkdir mediawiki20; cd mediawiki20
# the normal clone would be named "core" but we purposely rename to phase3; many of our symlinks use "phase3" back from 1.10 to 1.18
git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git phase3
cd /usr/share/mediawiki20/phase3 
rm extensions -r
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions.git
cd extensions; git submodule update --init
# Also insert the local-svn-managed extensions into the same folder:
cd /usr/share/mediawiki20/phase3/
sudo mkdir ext-LOCAL-svn; cd ext-LOCAL-svn; 
sudo svn checkout file:///var/lib/svn/LocalSVNextensions /usr/share/mediawiki20/phase3/ext-LOCAL-svn
sudo chown -R  www-data.www-data /usr/share/mediawiki20/phase3/ext-LOCAL-svn
sudo mv /usr/share/mediawiki20/phase3/ext-LOCAL-svn/* /usr/share/mediawiki20/phase3/extensions
sudo mv /usr/share/mediawiki20/phase3/ext-LOCAL-svn/.svn /usr/share/mediawiki20/phase3/extensions
sudo rm /usr/share/mediawiki20/phase3/ext-LOCAL-svn -r
# Problem: when a new svn folder is added to the local subversion repo,
#   this folder must manually chown to www-data; else svn co post-commit errors will occur.
# Widgets needs a writable folder:
sudo chown -R  www-data.www-data /usr/share/mediawiki20/phase3/extensions/Widgets/compiled_templates; 
# And widgets does not contain the necessary code:
# (Warning: require_once(/usr/share/mediawiki20/phase3/extensions/Widgets/smarty/Smarty.class.php): failed to open stream: No such file or directory in /usr/share/mediawiki20/phase3/extensions/Widgets/Widgets.php on line 53 etc.)
# in the absent of instructions, we use the previous 1.18 code: 
cp -r /usr/share/mediawikistaging/ext-tagged-release/Widgets/smarty /usr/share/mediawiki20/phase3/extensions/Widgets
cp -r /usr/share/mediawikistaging/ext-tagged-release/Widgets/googlecode /usr/share/mediawiki20/phase3/extensions/Widgets


To update do:

cd /usr/share/mediawiki20/; cd phase3; sudo git pull; 
cd /usr/share/mediawiki20/phase3/extensions; sudo git pull; sudo git submodule update --init;
# on Oct. the Persona branch would not update, all later extension were aborted. Partial solution:
# sudo git submodule update Q* R* S* T* U* V* W* X* Y* Z*  works!
cd /usr/share/mediawiki20/phase3/extensions; /usr/bin/svn update;

Switch to a tag (see all branches/tags: git branch -r | sort -V)

cd /usr/share/mediawiki20/phase3; git checkout REL1_20
### SMW extensions:
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticMediaWiki.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticMediaWiki; git checkout 1.7.1
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticCompoundQueries.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticCompoundQueries; git checkout 0.3.2
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticDrilldown.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticDrilldown; git checkout 1.2.2
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticForms.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticForms; git checkout 2.5.1
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticFormsInputs.git;a=tags
# cd /usr/share/mediawiki20/phase3/extensions/SemanticFormsInputs; git checkout DOES NOT EXIST YET
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticMaps.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticMaps; git checkout 2.0
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticInternalObjects.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticInternalObjects; git checkout 0.6.9
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticResultFormats.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/SemanticResultFormats; git checkout 1.7.1
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Maps.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/Maps; git checkout 2.0
# find tags: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Validator.git;a=tags
cd /usr/share/mediawiki20/phase3/extensions/Validator; git checkout 0.5
cd /var/www/testwiki_v20; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php 
sudo /usr/sbin/apache2ctl -k graceful  && sudo /etc/init.d/nginx restart
#switch back to master (Note: HEAD is head of current branch i.e. head after checkout REL1_20 is 1.20, not master.
cd /usr/share/mediawiki20/phase3; git checkout master^
# note: use "git branch"/" git branch -a" to check which branch is active.

new attempt of the above, with track option (with this, git pull will :

cd /usr/share/mediawiki20/phase3; git checkout --track origin/REL1_20

Useful for understanding git checkout, head, detached head, --track:


Temporary Solution for Lockdown and MediaFunctions (both used, but not available in git): copied to Local SVN, checked out as

  • Lockdown_LocalSVN, plus additional Link Lockdown
  • MediaFunctions_LocalSVN, plus additional Link MediaFunctions

TODO: Remove this work-around later once 1.20 is established! See http://www.mediawiki.org/wiki/Git/Conversion/Extensions_still_in_svn : both extensions are scheduled to be migrated to git.

On jQueryMsg: http://www.mediawiki.org/wiki/Git/Conversion/Extensions_still_in_svn says "jQueryMsg - Abandoned - Available in Core"

FileAttach: Used only as testing in testwikis, now removed there.

After this:

cd /var/www/testwiki_v20; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php

started to run, but terminated with error: "Database returned error "1170: BLOB/TEXT column 'acr_email' used in key specification without a key length (localhost)""

But: Did not solve the problem yet.... -- Also: creating a new db with all shared tables locally and a setting in LocalSettings: $wgSharedTables = array("interwiki"); did not help. Changed field type, see [1]. ./maintenance/update.php running through.

On Fri, Oct. 13 the previous errors could be resolved by updating and working around a corrupted git update (wikimedias error).

Main page loads, but Special pages cause error (in biowikifarm.net-error.log): 2012/10/13 00:55:52 [error] 1546#0: *723661 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'SMWSQLStore2' not found in /usr/share/mediawiki20/phase3/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php on line 56" while reading response header from upstream, client...

TESTING: http://biowikifarm.net/test_v20/Main_Page versus http://biowikifarm.net/test_v18/Main_Page (test with normal staging version, just for identical web server setup)

-> I guess all SMW extensions have to be modified to show a specific version, like in subversion...