Open main menu

Content translation/Product Definition/Database

< Content translation‎ | Product Definition

Content Translation needs a common database for all the wikis. This database is for storing the translation details of users between language pairs (i.e. between wikis).

Contents

SetupEdit

Here are sample shell and SQL commands to create the contenttranslation database. Replace USER with the value of $wgDbUser for your own wiki installation (LocalSettings.php).

$ cd extensions/ContentTranslation/sql
$ mysql -u root -p

Enter password for root SQL user, then run the following commands at the mysql prompt:

CREATE DATABASE contenttranslation;
USE contenttranslation;
GRANT ALL ON contenttranslation.* to 'USER'@'localhost';
SOURCE SCRIPTNAME.sql

BetaEdit

Content Translation database is setup as shared database "wikishared" on Beta Cluster.

AccessEdit

$ ssh deployment-tin.eqiad.wmflabs
$ mwscript sql.php --wiki=enwiki

ProductionEdit

In Wikimedia production environment, Content Translation tables are placed in side "extension1" shared database cluster. Database for Content Translation is "wikishared". In order to separate Content Translation tables from other tables, they are prefixed as 'cx'.

AccessEdit

  • Login to mwmaint1002
  • sql.php need to use with,
mwscript sql.php --wiki=LANGwiki --cluster extension1 --wikidb wikishared

Where LANG is wiki language code.

  • Queries can be run after that.
  • --write flag is needed to create new table. See: task T120815

manage-lists.phpEdit

  • Make sure to run script from latest code.
  • Run with following command,
mwscript extensions/ContentTranslation/scripts/manage-lists.php --wiki=LANGwiki --source xx --target yy --category "CATEGORY"

Add --really to really insert into DB.

ChangesEdit

Any changes in database for production environment must use the process described in https://wikitech.wikimedia.org/wiki/Schema_changes.

NotesEdit