User:Lucas Werkmeister (WMDE)/site ID investigation

Result of investigating Wikibase behavior when site IDs change.

The main example of a changed site ID that we have is Вікіпэдыя беларуская (тарашкевіца), or Wikipedia in Belarusian (Taraškievica orthography), whose language code used to be  but is now. Its database name remains  to this day, but it is now hosted on https://be-tarask.wikipedia.org/.

Behavior of Wikibase (and MediaWiki) with regards to that site, as of January 2021:


 * Special pages
 * SetSitelink: accepts be_x_oldwiki; does not accept be-x-old, be_taraskwiki, be-tarask.wikipedia.org
 * ItemByTitle: accepts be_x_oldwiki; does not accept be-x-old, be_taraskwiki, neither in URL nor in site selector/dropdown
 * GoToLinkedPage: accepts be_x_oldwiki; does not accept be-x-old, be_taraskwiki (and this one has no fancy site selector/dropdown, just a text input)
 * NewItem (?site=&page=): accepts be_x_oldwiki; does not accept be-x-old, be_taraskwiki (and in this one the site input is not even editable, so when it’s not recognized, the special page gives you an error on a readonly input field)
 * APIs
 * wbgetentities
 * returned data, sitelinks: uses be_x_oldwiki, site: be_x_oldwiki, url: https://be-tarask.wikipedia.org/wiki/ ...
 * sites=&titles= parameters: accepts be_x_oldwiki; does not accept be_taraskwiki, be-x-old, be-x-old.wikipedia.org, be-tarask.wikipedia.org
 * wbsetsitelink (linksite=): accepts be_x_oldwiki; does not accept be_taraskwiki, be-x-old, be-x-old.wikipedia.org, be-tarask.wikipedia.org
 * query, prop=langlinks
 * returned data: uses lang be-x-old, url https://be-tarask.wikipedia.org/wiki/ ...
 * lllang parameter: accepts be-x-old; does not accept be-tarask, be_x_old, be_x_oldwiki (it’s not reported as an error, there are just no results)
 * sitematrix: two entries
 * code: be-tarask, site: []
 * code: be-x-old, site: [ { url: https://be-tarask.wikipedia.org, dbname: be_x_oldwiki } ]
 * query, meta=siteinfo, siprop=interwikimap: two entries
 * prefix: be-tarask, url: https://be-tarask.wikipedia.org/wiki/$1
 * prefix: be-x-old, url: https://be-tarask.wikipedia.org/wiki/$1
 * interactive UIs
 * repo (item) sitelink editing: accepts be_x_oldwiki, be_tarask.wikipedia.org, be-tarask.wikipedia.org, and prefixes thereof (all converted to be_x_oldwiki upon selection); does not accept be-x-old, be_taraskwiki
 * client sitelink creation: accepts be_x_oldwiki, be_tarask.wikipedia.org, be-tarask.wikipedia.org, and prefixes thereof (all converted to be_x_oldwiki upon selection); does not accept be-x-old, be_taraskwiki
 * Lua
 * mw.wikibase.getEntity returned data, sitelinks: contains be_x_oldwiki and nothing else
 * mw.wikibase.getSitelink: returns data for be_x_oldwiki and nothing else
 * entity:getSitelink: returns data for be_x_oldwiki and nothing else
 * mw.wikibase.getEntityIdForTitle: accepts be_x_oldwiki; does not accept be_taraskwiki, be-x-old, be-x-old.wikipedia.org, be-tarask.wikipedia.org
 * mw.site.interwikiMap: contains be-tarask and be-x-old (like siprop=interwikimap above)
 * I found no equivalent of prop=langlinks