As part of T59336: Make metawiki the central OAuth wiki, OAuth data (oauth_registered_consumer table, oauth_accepted_consumer table and OAuth records in the log table) needs to be moved to the Meta database. The data consist of about 250 consumers, 16000 acceptances (authorizations) and 500 OAuth log records.
Beta migration (done)
- set $wgMWOAuthReadOnly = true for all beta wikis
- run mwscript sql.php --wiki=metawiki php-master/extensions/OAuth/backend/schema/mysql/OAuth.sql on deployment-bastion
- run mwscript sql.php --wiki=metawiki php-master/extensions/OAuth/backend/schema/mysql/callback_is_prefix.sql
- run mwscript sql.php --wiki=metawiki php-master/extensions/OAuth/backend/schema/mysql/developer_agreement.sql
- run mwscript extensions/OAuth/maintenance/migrateCentralWiki.php --wiki=metawiki --old=deploymentwiki --target=metawiki --table=oauth_registered_consumer
- run mwscript extensions/OAuth/maintenance/migrateCentralWiki.php --wiki=metawiki --old=deploymentwiki --target=metawiki --table=oauth_accepted_consumer
- set $wgMWOAuthCentralWiki = 'metawiki' for all wikis
- set $wgMWOAuthReadOnly = false for all wikis
- run mwscript extensions/OAuth/maintenance/importCentralWikiLogs.php --wiki=metawiki --old=deploymentwiki
Test migration (done)
- run mwscript extensions/OAuth/maintenance/importCentralWikiLogs.php --wiki=aawiki --old=mediawikiwiki
(no need to test migration of OAuth tables - they don't exist on Meta now so it's low risk)
Real migration
- set $wgMWOAuthReadOnly = true for all wikis gerrit 233608
- run mwscript sql.php --wiki=metawiki php-1.26wmf20/extensions/OAuth/backend/schema/mysql/OAuth.sql on terbium
- run mwscript sql.php --wiki=metawiki php-1.26wmf20/extensions/OAuth/backend/schema/mysql/callback_is_prefix.sql
- run mwscript sql.php --wiki=metawiki php-1.26wmf20/extensions/OAuth/backend/schema/mysql/developer_agreement.sql
- run mwscript extensions/OAuth/maintenance/migrateCentralWiki.php --wiki=metawiki --old=mediawikiwiki --target=metawiki --table=oauth_registered_consumer
- run mwscript extensions/OAuth/maintenance/migrateCentralWiki.php --wiki=metawiki --old=mediawikiwiki --target=metawiki --table=oauth_accepted_consumer
- set $wgMWOAuthCentralWiki = 'metawiki' for all wikis gerrit 233609
- set $wgMWOAuthReadOnly = false for all wikis gerrit 233610
- run mwscript extensions/OAuth/maintenance/importCentralWikiLogs.php --wiki=metawiki --old=mediawikiwiki
Testing
- authorize Hello World app before migration, verify it's still authorized afterwards
- test deauthorizing/reauthorizing it
- register a new consumer, test userinfo API via mwoauth