Page MenuHomeDevCentral

Migrate Wolfplex wiki tables on a dedicated database
Closed, ResolvedPublic

Description

The wolfplexdb database currently contains tables for several applications, including two sets of tables for MediaWiki: mw_ and mw2_.

This creates a configuration burden:

  1. We need to maintain a dictionary of prefixes by wiki (1)
  2. We can't easily run a maintenance script without using MediaWiki code to read that configuration (2)

Plan:

  1. Create a new dedicated wolfplex_wiki database
  2. Set wolfplex wiki in read-only mode
  3. Migrate tables to wolfplex_wiki
  4. Remove custom wgDBprefix value
  5. Reload php-fpm
  6. Se back wolfplex wiki in read-write mode

Other wikis are not in scope of this task, as we currently don't need to run maintenance scripts on those.


(1) the configuration in SaaS contains 4 prefixes:

config/Settings.php
'wgDBprefix' => [
    'default' => '',

    // Legacy installations
    'arsmagica' => 'arsm_',
    'utopia' => 'wiki_',
    'wolfplex' => 'mw_', // shared database
],

Note this was already tagged as legacy in March 2018 (the comment is from 22c2512).


(2) applying D3736:

$ salt db-B-001 state.apply roles/dbserver-mysql/content 

[...]
---------                                                                                                                                                                                                           
          ID: dbserver_mysql_user_saas-mw-deploy_privilege_1_interwiki                                                                                                                                               
    Function: mysql_grants.present                                                                                                                                                                                   
      Result: True                                                                                                                                                                                                   
     Comment: Grant SELECT, INSERT, DELETE on nasqueron_wiki.interwiki to saas-mw-deploy@172.27.27.10 is already present                                                                                             
     Started: 12:29:27.597494                                                                                                                                                                                        
    Duration: 8.7 ms  
     Changes:   
----------
          ID: dbserver_mysql_user_saas-mw-deploy_privilege_2_interwiki
    Function: mysql_grants.present
      Result: False
     Comment: Failed to execute: "GRANT SELECT, INSERT, DELETE ON wolfplexdb.interwiki TO saas-mw-deploy@172.27.27.10" (MySQL Error 1146: Table 'wolfplexdb.interwiki' doesn't exist)
     Started: 12:29:27.606764
    Duration: 11.573 ms
     Changes:  
[...]

What would be the source of truth if I define the prefix in rOPS too? the saas/mediawiki.sls pillar or the MediaWiki configuration ?

Event Timeline

dereckson updated the task description. (Show Details)
dereckson moved this task from Backlog to Operations on the Mediawiki SaaS board.
dereckson moved this task from Backlog to Working on on the Wolfplex migration board.
dereckson moved this task from Backlog to Queries on the DBA board.
dereckson added a subscriber: ledesillusionniste.

Wolfplex wiki is in read-only mode.

Import to wolfplex_wiki database done.

Table object_cache content not imported, contains lot of references to wolfplexdb/mw_.

Tables containing user backup and Semantic MediaWiki data imported too.

Wiki is now using wolfplex_wiki database.

Reenabling write mode.

Write is working.

Maintenance done.