Actor migration

Historically, MediaWiki has stored references to users (such as the author of a revision or an image) as an  pair, with   for anonymous edits. This was a waste of storage space, caused performance issues on wikis with a huge number of revisions, and made it very hard to rename users or introduce new types of authors such as T133452. MediaWiki 1.31 introduces the concept of actors (someone who makes an action, such as an edit or a log event; currently either a registered user or an anonymous one), and a migration process towards a new database schema, with fields like   and   replaced by fields like  . Due to the huge size of the English Wikipedia revision table, which must be fully migrated before the changes can be cleaned up, the migration is being done gradually, over several MediaWiki releases. It is expected to finish in MediaWiki 1.34.

The migration will create an  table record for every distinct   /   pair, and replace those pairs with a reference to the actor row ID. The following columns are being migrated:

To avoid doing a costly <tvar|1>ALTER TABLE</> on the extremely huge <tvar|6>revision</> tables of large Wikipedia wikis, <tvar|2> </> and <tvar|3> </> are initially copied to the <tvar|4></> table and from there back to <tvar|5> </>. The <tvar|1>revision_actor_temp</> table will be dropped afterwards.

If you are a wiki owner, you probably don't need to do anything, the migration will happen automatically when you run <tvar|1> </>. If you want to control when the migration happens, see <tvar|1></> and the <tvar|2></> maintenance script.

If you are an extension developer, and your extension does direct DB access to some of the affected fields, you'll need to update your queries (and ideally use the <tvar|1> </> methods, such as <tvar|2></>, instead of manually constructing your query). During the migration period, you can also use the <tvar|1> </> class to get schema/field information that respects any <tvar|2> </> settings.

If you are a tool developer using <tvar|1></>, there might be performance implications, even if you don't use any of the affected fields directly. See 1>wikitech:News/Actor storage changes on the Wiki Replicas</>|wikitech:News/Actor storage changes on the Wiki Replicas for additional information.