Mediawiki Update Version 1.15.0 vers 1.17.0
L'installation initiale de MediaWiki a été faite à l'aide de la commande aptitude
sur Ubuntu. Or aucune mise à jour n'a été réalisée automatiquement. Cette procédure décrit la montée de version réalisée manuellement sur la machine.
Sommaire
Votre avis
Current user rating: 95/100 (1 votes)
|
|
Backup
La base de donnée est sauvegardée à l'aide d'un dump MySql:
#/usr/bin/mysqldump --user=root -p --default-character-set=latin1 -c --skip-set-charset wikidb > dump.sql
Ici, la base de données est wikidb
. Le dump est généré dans le fichier dump.sql.
Trois répertoires sont également sauvegardés, et placé dans le répertoire /opt/mediawiki_backup
:
#sudo mkdir /opt/mediawiki_backup #sudo mkdir /opt/mediawiki_backup/etc #sudo mkdir /opt/mediawiki_backup/etc/mediawiki #sudo cp -R /etc/mediawiki/* /opt/mediawiki_backup/etc/mediawiki/ #sudo mkdir /opt/mediawiki_backup/var #sudo mkdir /opt/mediawiki_backup/var/lib #sudo mkdir /opt/mediawiki_backup/var/lib/mediawiki #sudo cp -R /var/lib/mediawiki/* /opt/mediawiki_backup/var/lib/mediawiki/ #sudo mkdir /opt/mediawiki_backup/usr #sudo mkdir /opt/mediawiki_backup/usr/share #sudo mkdir /opt/mediawiki_backup/usr/share/mediawiki #sudo cp -R /usr/share/mediawiki/* /opt/mediawiki_backup/usr/share/mediawiki/ cp: impossible d'évaluer «/usr/share/mediawiki/AdminSettings.php»: Aucun fichier ou dossier de ce type cp: omission du répertoire «/usr/share/mediawiki/config» cp: omission du répertoire «/usr/share/mediawiki/extensions» cp: omission du répertoire «/usr/share/mediawiki/images» cp: omission du répertoire «/usr/share/mediawiki/includes» cp: omission du répertoire «/usr/share/mediawiki/languages» cp: omission du répertoire «/usr/share/mediawiki/maintenance» cp: omission du répertoire «/usr/share/mediawiki/skins»
Analyse installation précédente version
L'installation initiale depuis les paquets met en place un ensemble de lien. Afin de conserver cette logique, il est nécessaire d'étudier cette organisation pour essayer de la reproduire:
Composition du répertoire /etc/mediawiki
:
drwxr-xr-x 2 www-data www-data 4096 2011-11-12 22:37 ./ drwxr-xr-x 157 root root 12288 2011-11-11 11:26 ../ -rw-r--r-- 1 www-data www-data 470 2010-12-14 21:10 apache.conf -rw------- 1 www-data www-data 5368 2011-11-12 22:32 LocalSettings.php
Composition du répertoire /var/lib/mediawiki
:
lrwxrwxrwx 1 root root 32 2011-08-19 22:18 AdminSettings.php -> /etc/mediawiki/AdminSettings.php lrwxrwxrwx 1 root root 28 2011-08-19 22:18 api.php -> /usr/share/mediawiki/api.php drwx------ 2 www-data www-data 4096 2011-10-19 23:50 config/ drwxr-xr-x 7 www-data www-data 4096 2011-10-19 23:50 extensions/ drwx------ 22 www-data www-data 4096 2010-12-14 21:35 images/ lrwxrwxrwx 1 root root 33 2011-08-19 22:18 img_auth.php -> /usr/share/mediawiki/img_auth.php lrwxrwxrwx 1 www-data www-data 29 2010-12-14 21:06 includes -> /usr/share/mediawiki/includes/ lrwxrwxrwx 1 root root 30 2011-08-19 22:18 index.php -> /usr/share/mediawiki/index.php lrwxrwxrwx 1 root root 38 2011-08-19 22:18 install-utils.inc -> /usr/share/mediawiki/install-utils.inc lrwxrwxrwx 1 www-data www-data 30 2010-12-14 21:06 languages -> /usr/share/mediawiki/languages/ lrwxrwxrwx 1 root root 32 2011-08-19 22:18 LocalSettings.php -> /etc/mediawiki/LocalSettings.php lrwxrwxrwx 1 www-data www-data 32 2010-12-14 21:06 maintenance -> /usr/share/mediawiki/maintenance/ lrwxrwxrwx 1 root root 40 2011-08-19 22:18 opensearch_desc.php -> /usr/share/mediawiki/opensearch_desc.php lrwxrwxrwx 1 root root 36 2011-08-19 22:18 profileinfo.php -> /usr/share/mediawiki/profileinfo.php lrwxrwxrwx 1 root root 33 2011-08-19 22:18 redirect.php -> /usr/share/mediawiki/redirect.php lrwxrwxrwx 1 root root 35 2011-08-19 22:18 redirect.phtml -> /usr/share/mediawiki/redirect.phtml lrwxrwxrwx 1 www-data www-data 26 2010-12-14 21:06 skins -> /usr/share/mediawiki/skins/ lrwxrwxrwx 1 root root 38 2011-08-19 22:18 StartProfiler.php -> /usr/share/mediawiki/StartProfiler.php lrwxrwxrwx 1 root root 30 2011-08-19 22:18 thumb.php -> /usr/share/mediawiki/thumb.php lrwxrwxrwx 1 root root 34 2011-08-19 22:18 trackback.php -> /usr/share/mediawiki/trackback.php lrwxrwxrwx 1 root root 31 2011-08-19 22:18 wiki.phtml -> /usr/share/mediawiki/wiki.phtml
Ce répertoire ne contient donc que des liens vers les fichiers dans /usr/share/mediawiki
.
Les répertoires config
, extensions
et images
sont spécifiques à cette implémentation, ainsi que les liens LocalSettings.php
et AdminSettings.php
, qui n'existe pas d'ailleurs.
Cette organisation est très pertinentes pour l'installation de plusieurs Wiki, mais partageant les mêmes sources.
/usr/share/mediawiki
:lrwxrwxrwx 1 root root 36 2011-08-19 22:18 AdminSettings.php -> /var/lib/mediawiki/AdminSettings.php -rw-r--r-- 1 root root 3321 2009-05-05 16:07 api.php lrwxrwxrwx 1 www-data www-data 25 2010-12-14 21:06 config -> /var/lib/mediawiki/config/ lrwxrwxrwx 1 www-data www-data 29 2010-12-14 21:06 extensions -> /var/lib/mediawiki/extensions/ lrwxrwxrwx 1 www-data www-data 25 2010-12-14 21:06 images -> /var/lib/mediawiki/images/ -rw-r--r-- 1 root root 3192 2009-03-21 17:48 img_auth.php drwxr-xr-x 13 www-data www-data 20480 2011-10-19 23:50 includes/ -rw-r--r-- 1 root root 4281 2009-03-20 13:00 index.php -rw-r--r-- 1 root root 5839 2010-03-08 18:42 install-utils.inc drwxr-xr-x 4 www-data www-data 4096 2011-10-19 23:50 languages/ lrwxrwxrwx 1 root root 36 2011-08-19 22:18 LocalSettings.php -> /var/lib/mediawiki/LocalSettings.php drwxr-xr-x 12 www-data www-data 20480 2011-10-19 23:50 maintenance/ -rw-r--r-- 1 root root 3054 2009-03-21 17:48 opensearch_desc.php -rw-r--r-- 1 root root 9345 2010-07-27 09:56 profileinfo.php -rw-r--r-- 1 root root 383 2009-03-21 17:48 redirect.php -rw-r--r-- 1 root root 91 2005-01-31 21:35 redirect.phtml drwxr-xr-x 9 www-data www-data 4096 2011-10-19 23:50 skins/ -rw-r--r-- 1 root root 603 2009-01-07 22:11 StartProfiler.php -rw-r--r-- 1 root root 4905 2010-03-08 23:49 thumb.php -rw-r--r-- 1 root root 1347 2008-11-05 17:54 trackback.php -rw-r--r-- 1 root root 88 2005-01-31 21:35 wiki.phtml
/var/lib/mediawiki
.
Installation nouvelle version
Le fichier mediawiki-1.17.0.tar.gz
est téléchargé, depuis http://www.mediawiki.org/wiki/Download, et placé dans le répertoire /usr/share
. La décompression de ce tar va créé les fichiers à installer juste à côté de l'installation active:
#cd /usr/share #sudo tar -xzf mediawiki-1.17.0.tar.gz #sudo chown -R www-data:www-data /usr/share/mediawiki-1.17.0
Mise en place instance
Une fois déployée, une nouvelle instance est mise en place à l'aide des liens comme cela a été réalisé pour la précédente version. Mais il faut noter le fichier OBSOLETE
dans le répertoire config
, sur lequel le lien sera quand même mis en place. Le répertoire maintenance
ne sera pas lié, car il contient les fichiers de mise à jour non nécessaire au bon fonctionnement.
Les répertoires suivants sont copiés depuis la précédente installation:
- extensions: Contient les extensions installés
- images: Contient les images précédemment mises en place sur la précédente version.
#sudo mkdir /var/lib/mediawiki-1.17.0 #sudo cp -R /var/lib/mediawiki/extensions /var/lib/mediawiki-1.17.0 #sudo cp -R /var/lib/mediawiki/images /var/lib/mediawiki-1.17.0 #sudo ln -s /etc/mediawiki/AdminSettings.php /var/lib/mediawiki-1.17.0/AdminSettings.php #sudo ln -s /etc/mediawiki/LocalSettings.php /var/lib/mediawiki-1.17.0/LocalSettings.php #sudo ln -s /usr/share/mediawiki-1.17.0/api.php /var/lib/mediawiki-1.17.0/api.php #sudo ln -s /usr/share/mediawiki-1.17.0/api.php5 /var/lib/mediawiki-1.17.0/api.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/bin /var/lib/mediawiki-1.17.0/bin #sudo ln -s /usr/share/mediawiki-1.17.0/cache /var/lib/mediawiki-1.17.0/cache #sudo ln -s /usr/share/mediawiki-1.17.0/img_auth.php /var/lib/mediawiki-1.17.0/img_auth.php #sudo ln -s /usr/share/mediawiki-1.17.0/img_auth.php5 /var/lib/mediawiki-1.17.0/img_auth.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/includes /var/lib/mediawiki-1.17.0/includes #sudo ln -s /usr/share/mediawiki-1.17.0/index.php /var/lib/mediawiki-1.17.0/index.php #sudo ln -s /usr/share/mediawiki-1.17.0/index.php5 /var/lib/mediawiki-1.17.0/index.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/languages /var/lib/mediawiki-1.17.0/languages #sudo ln -s /usr/share/mediawiki-1.17.0/load.php /var/lib/mediawiki-1.17.0/load.php #sudo ln -s /usr/share/mediawiki-1.17.0/load.php5 /var/lib/mediawiki-1.17.0/load.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/math /var/lib/mediawiki-1.17.0/math #sudo ln -s /usr/share/mediawiki-1.17.0/mw-config /var/lib/mediawiki-1.17.0/mw-config #sudo ln -s /usr/share/mediawiki-1.17.0/opensearch_desc.php /var/lib/mediawiki-1.17.0/opensearch_desc.php #sudo ln -s /usr/share/mediawiki-1.17.0/opensearch_desc.php5 /var/lib/mediawiki-1.17.0/opensearch_desc.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/php5.php5 /var/lib/mediawiki-1.17.0/php5.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/profileinfo.php /var/lib/mediawiki-1.17.0/profileinfo.php #sudo ln -s /usr/share/mediawiki-1.17.0/redirect.php /var/lib/mediawiki-1.17.0/redirect.php #sudo ln -s /usr/share/mediawiki-1.17.0/redirect.php5 /var/lib/mediawiki-1.17.0/redirect.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/redirect.phtml /var/lib/mediawiki-1.17.0/redirect.phtml #sudo ln -s /usr/share/mediawiki-1.17.0/resources /var/lib/mediawiki-1.17.0/resources #sudo ln -s /usr/share/mediawiki-1.17.0/serialized /var/lib/mediawiki-1.17.0/serialized #sudo ln -s /usr/share/mediawiki-1.17.0/skins /var/lib/mediawiki-1.17.0/skins #sudo ln -s /usr/share/mediawiki-1.17.0/StartProfiler.sample /var/lib/mediawiki-1.17.0/StartProfiler.sample #sudo ln -s /usr/share/mediawiki-1.17.0/thumb.php /var/lib/mediawiki-1.17.0/thumb.php #sudo ln -s /usr/share/mediawiki-1.17.0/thumb.php5 /var/lib/mediawiki-1.17.0/thumb.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/trackback.php /var/lib/mediawiki-1.17.0/trackback.php #sudo ln -s /usr/share/mediawiki-1.17.0/trackback.php5 /var/lib/mediawiki-1.17.0/trackback.php5 #sudo ln -s /usr/share/mediawiki-1.17.0/wiki.phtml /var/lib/mediawiki-1.17.0/wiki.phtml
Mise à jour de la base de données
Les exemples d'exécution montre la nécessité d'avoir les droits d'accès suivants sur la base de données, dans le cas de MySql:
- create: Pour la création de nouvelles tables.
- alter: Pour la mise à jour de tables existantes.
- index: Pour la création de nouveaux index.
En supposant que le compte utilisé est wikiuser
, et la base de données wikidb
, les trois requêtes SQL doivent être exécutées. En effet, après la précédente installation les droits avaient été supprimés:
mysql> GRANT CREATE ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALTER ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT INDEX ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 ROWS affected (0.00 sec)
La mise à jour s'effectue par l'exécution du script update.php
, situé dans le répertoire maintenance
de l'installation:
#cd /usr/share/mediawiki-1.17.0/maintenance #php update.php A copy of your installation's LocalSettings.php must exist and be readable in the source directory. Use --conf to specify it.
Le message d'erreur est suffisamment clair, le fichier LocalSettings.php
n'est pas trouvé. Celui-ci est nécessaire car il contient les informations de connexion à la base de données par exemple.
#php update.php --conf /etc/mediawiki/LocalSettings.php PHP Notice: Constant UNICODE_HANGUL_FIRST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 3 PHP Notice: Constant UNICODE_HANGUL_LAST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 4 PHP Notice: Constant UNICODE_HANGUL_LBASE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 6 PHP Notice: Constant UNICODE_HANGUL_VBASE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 7 PHP Notice: Constant UNICODE_HANGUL_TBASE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 8 PHP Notice: Constant UNICODE_HANGUL_LCOUNT already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 10 PHP Notice: Constant UNICODE_HANGUL_VCOUNT already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 11 PHP Notice: Constant UNICODE_HANGUL_TCOUNT already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 12 PHP Notice: Constant UNICODE_HANGUL_NCOUNT already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 13 PHP Notice: Constant UNICODE_HANGUL_LEND already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 15 PHP Notice: Constant UNICODE_HANGUL_VEND already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 16 PHP Notice: Constant UNICODE_HANGUL_TEND already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 17 PHP Notice: Constant UNICODE_SURROGATE_FIRST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 19 PHP Notice: Constant UNICODE_SURROGATE_LAST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 20 PHP Notice: Constant UNICODE_MAX already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 21 PHP Notice: Constant UNICODE_REPLACEMENT already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 22 PHP Notice: Constant UTF8_HANGUL_FIRST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 25 PHP Notice: Constant UTF8_HANGUL_LAST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 26 PHP Notice: Constant UTF8_HANGUL_LBASE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 28 PHP Notice: Constant UTF8_HANGUL_VBASE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 29 PHP Notice: Constant UTF8_HANGUL_TBASE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 30 PHP Notice: Constant UTF8_HANGUL_LEND already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 32 PHP Notice: Constant UTF8_HANGUL_VEND already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 33 PHP Notice: Constant UTF8_HANGUL_TEND already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 34 PHP Notice: Constant UTF8_SURROGATE_FIRST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 36 PHP Notice: Constant UTF8_SURROGATE_LAST already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 37 PHP Notice: Constant UTF8_MAX already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 38 PHP Notice: Constant UTF8_REPLACEMENT already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 39 PHP Notice: Constant UTF8_OVERLONG_A already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 42 PHP Notice: Constant UTF8_OVERLONG_B already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 43 PHP Notice: Constant UTF8_OVERLONG_C already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 44 PHP Notice: Constant UTF8_FDD0 already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 47 PHP Notice: Constant UTF8_FDEF already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 48 PHP Notice: Constant UTF8_FFFE already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 49 PHP Notice: Constant UTF8_FFFF already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 50 PHP Notice: Constant UTF8_HEAD already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 52 PHP Notice: Constant UTF8_TAIL already defined in /usr/share/mediawiki/includes/normal/UtfNormalDefines.php on line 53 PHP Warning: require_once(/var/lib/mediawiki/maintenance/install-utils.inc): failed to open stream: No such file or directory in /usr/share/mediawiki-1.17.0/maintenance/doMaintenance.php on line 101 PHP Fatal error: require_once(): Failed opening required '/var/lib/mediawiki/maintenance/install-utils.inc' (include_path='/var/lib/mediawiki:/var/lib/mediawiki/includes:/var/lib/mediawiki/languages:.:/usr/share/php:/usr/share/pear') in /usr/share/mediawiki-1.17.0/maintenance/doMaintenance.php on line 101
Sur cette tentative, le message d'erreur indique que le fichier /var/lib/mediawiki/maintenance/install-utils.inc
n'est pas trouvé. L'emplacement du fichier est tout simplement erroné. Il aurait du être recherché à l'emplacement /var/lib/mediawiki-1.17.0/maintenance/install-utils.inc
.
En fait, il y a un paramètre dans le fichier LocalSettings.php
indiquant l'emplacement d'installation. Or ceci n'a pas été modifié. Il faut mettre à jour la valeur du paramètre MW_INSTALL_PATH
, après sauvegarde du précédent fichier pour un peu plus de sécurité en cas de fausse manipulation.
# define('MW_INSTALL_PATH','/var/lib/mediawiki');
define('MW_INSTALL_PATH','/var/lib/mediawiki-1.17.0');
# php update.php --conf /etc/mediawiki/LocalSettings.php MediaWiki 1.17.0 Updater Going to run database updates for wikidb-ejnwiki_ Depending on the size of your database this may take a while! Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0 ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...have user_real_name field in user table. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. ...have pagelinks; skipping old links table updates ...il_from OK ...have rc_ip field in recentchanges table. ...PRIMARY key already set on image table. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...have user_token field in user table. ...have wl_notificationtimestamp field in watchlist table. ...watchlist talk page rows already present ...user table does not contain user_emailauthenticationtimestamp field. ...page table already exists. ...have log_params field in logging table. ...logging table has correct log_title encoding. ...have ar_rev_id field in archive table. ...have page_len field in page table. ...revision table does not contain inverse_timestamp field. ...have rev_text_id field in revision table. ...have rev_deleted field in revision table. ...have img_width field in image table. ...have img_metadata field in image table. ...have user_email_token field in user table. ...have ar_text_id field in archive table. ...page_namespace is already a full int (int(11)). ...ar_namespace is already a full int (int(11)). ...rc_namespace is already a full int (int(11)). ...wl_namespace is already a full int (int(11)). ...qc_namespace is already a full int (int(11)). ...log_namespace is already a full int (int(11)). ...have img_media_type field in image table. ...already have pagelinks table. ...image table does not contain img_type field. ...already have unique user_name index. ...user_groups table exists and is in current format. ...have ss_total_pages field in site_stats table. ...user_newtalk table already exists. ...transcache table already exists. ...have iw_trans field in interwiki table. ...trackbacks table already exists. ...wl_notificationtimestamp is already nullable. ...times key already set on logging table. ...have ipb_range_start field in ipblocks table. ...no page_random rows needed to be set ...have user_registration field in user table. ...templatelinks table already exists ...externallinks table already exists. ...job table already exists. ...have ss_images field in site_stats table. ...langlinks table already exists. ...querycache_info table already exists. ...filearchive table already exists. ...have ipb_anon_only field in ipblocks table. ...rc_ns_usertext key already set on recentchanges table. ...rc_user_text key already set on recentchanges table. ...have user_newpass_time field in user table. ...redirect table already exists. ...querycachetwo table already exists. ...have ipb_enable_autoblock field in ipblocks table. ...index pl_namespace on table pagelinks includes field pl_from ...index tl_namespace on table templatelinks includes field tl_from ...index il_to on table imagelinks includes field il_from ...have rc_old_len field in recentchanges table. ...have user_editcount field in user table. ...page_restrictions table already exists. ...have log_id field in logging table. ...have rev_parent_id field in revision table. ...have pr_id field in page_restrictions table. ...have rev_len field in revision table. ...have rc_deleted field in recentchanges table. ...have log_deleted field in logging table. ...have ar_deleted field in archive table. ...have ipb_deleted field in ipblocks table. ...have fa_deleted field in filearchive table. ...have ar_len field in archive table. ...have ipb_block_email field in ipblocks table. ...index cl_sortkey on table categorylinks includes field cl_from ...have oi_metadata field in oldimage table. ...usertext_timestamp key already set on archive table. ...img_usertext_timestamp key already set on image table. ...oi_usertext_timestamp key already set on oldimage table. ...have ar_page_id field in archive table. ...have img_sha1 field in image table. ...protected_titles table already exists. ...have ipb_by_text field in ipblocks table. ...page_props table already exists. ...updatelog table already exists. ...category table already exists. Populating category table, printing progress markers. For large databases, you may want to hit Ctrl-C and do this manually with maintenance/ populateCategory.php. Category population complete. Done populating category table. ...have ar_parent_id field in archive table. ...have user_last_timestamp field in user_newtalk table. Populating rev_parent_id column ...doing rev_id from 1 to 200 ...doing rev_id from 201 to 400 ...doing rev_id from 401 to 600 ...doing rev_id from 601 to 800 ...doing rev_id from 801 to 1000 ...doing rev_id from 1001 to 1200 ...doing rev_id from 1201 to 1400 ...doing rev_id from 1401 to 1600 ...doing rev_id from 1601 to 1800 ...doing rev_id from 1801 to 2000 ...doing rev_id from 2001 to 2200 ...doing rev_id from 2201 to 2400 ...doing rev_id from 2401 to 2600 rev_parent_id population complete ... 2454 rows [0 changed] ...protected_titles table has correct pt_title encoding. ...have ss_active_users field in site_stats table. ...ss_active_users user count set... ...have ipb_allow_usertalk field in ipblocks table. ...pl_namespace, tl_namespace, il_to indices are already UNIQUE. ...change_tag table already exists. ...tag_summary table already exists. ...valid_tag table already exists. Creating user_properties table...A database query syntax error has occurred. The last attempted database query was: "CREATE TABLE `ejnwiki_user_properties`( up_user int not null, up_property varbinary(32) not null, up_value blob ) ENGINE=InnoDB, DEFAULT CHARSET=binary " from within function "DatabaseBase::sourceFile( /usr/share/mediawiki-1.17.0/maintenance/archives/patch-user_properties.sql )". Database returned error "1142: CREATE command denied to user 'wikiuser'@'localhost' for table 'ejnwiki_user_properties' (localhost)"
Le message d'erreur indique donc la nécessité du privilège de création de tables au niveau de la base de données. Ce privilège est accordé par la commande SQL suivante, sous Mysql:
mysql> GRANT CREATE ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 ROWS affected (0.00 sec)
# php update.php --conf /etc/mediawiki/LocalSettings.php MediaWiki 1.17.0 Updater Going to run database updates for wikidb-ejnwiki_ Depending on the size of your database this may take a while! Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0 ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...have user_real_name field in user table. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. ...have pagelinks; skipping old links table updates ...il_from OK ...have rc_ip field in recentchanges table. ...PRIMARY key already set on image table. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...have user_token field in user table. ...have wl_notificationtimestamp field in watchlist table. ...watchlist talk page rows already present ...user table does not contain user_emailauthenticationtimestamp field. ...page table already exists. ...have log_params field in logging table. ...logging table has correct log_title encoding. ...have ar_rev_id field in archive table. ...have page_len field in page table. ...revision table does not contain inverse_timestamp field. ...have rev_text_id field in revision table. ...have rev_deleted field in revision table. ...have img_width field in image table. ...have img_metadata field in image table. ...have user_email_token field in user table. ...have ar_text_id field in archive table. ...page_namespace is already a full int (int(11)). ...ar_namespace is already a full int (int(11)). ...rc_namespace is already a full int (int(11)). ...wl_namespace is already a full int (int(11)). ...qc_namespace is already a full int (int(11)). ...log_namespace is already a full int (int(11)). ...have img_media_type field in image table. ...already have pagelinks table. ...image table does not contain img_type field. ...already have unique user_name index. ...user_groups table exists and is in current format. ...have ss_total_pages field in site_stats table. ...user_newtalk table already exists. ...transcache table already exists. ...have iw_trans field in interwiki table. ...trackbacks table already exists. ...wl_notificationtimestamp is already nullable. ...times key already set on logging table. ...have ipb_range_start field in ipblocks table. ...no page_random rows needed to be set ...have user_registration field in user table. ...templatelinks table already exists ...externallinks table already exists. ...job table already exists. ...have ss_images field in site_stats table. ...langlinks table already exists. ...querycache_info table already exists. ...filearchive table already exists. ...have ipb_anon_only field in ipblocks table. ...rc_ns_usertext key already set on recentchanges table. ...rc_user_text key already set on recentchanges table. ...have user_newpass_time field in user table. ...redirect table already exists. ...querycachetwo table already exists. ...have ipb_enable_autoblock field in ipblocks table. ...index pl_namespace on table pagelinks includes field pl_from ...index tl_namespace on table templatelinks includes field tl_from ...index il_to on table imagelinks includes field il_from ...have rc_old_len field in recentchanges table. ...have user_editcount field in user table. ...page_restrictions table already exists. ...have log_id field in logging table. ...have rev_parent_id field in revision table. ...have pr_id field in page_restrictions table. ...have rev_len field in revision table. ...have rc_deleted field in recentchanges table. ...have log_deleted field in logging table. ...have ar_deleted field in archive table. ...have ipb_deleted field in ipblocks table. ...have fa_deleted field in filearchive table. ...have ar_len field in archive table. ...have ipb_block_email field in ipblocks table. ...index cl_sortkey on table categorylinks includes field cl_from ...have oi_metadata field in oldimage table. ...usertext_timestamp key already set on archive table. ...img_usertext_timestamp key already set on image table. ...oi_usertext_timestamp key already set on oldimage table. ...have ar_page_id field in archive table. ...have img_sha1 field in image table. ...protected_titles table already exists. ...have ipb_by_text field in ipblocks table. ...page_props table already exists. ...updatelog table already exists. ...category table already exists. ...category table already populated. ...have ar_parent_id field in archive table. ...have user_last_timestamp field in user_newtalk table. ...rev_parent_id column already populated. ...protected_titles table has correct pt_title encoding. ...have ss_active_users field in site_stats table. ...ss_active_users user count set... ...have ipb_allow_usertalk field in ipblocks table. ...pl_namespace, tl_namespace, il_to indices are already UNIQUE. ...change_tag table already exists. ...tag_summary table already exists. ...valid_tag table already exists. Creating user_properties table...A database query syntax error has occurred. The last attempted database query was: "CREATE UNIQUE INDEX user_properties_user_property on `ejnwiki_user_properties` (up_user,up_property) " from within function "DatabaseBase::sourceFile( /usr/share/mediawiki-1.17.0/maintenance/archives/patch-user_properties.sql )". Database returned error "1142: INDEX command denied to user 'wikiuser'@'localhost' for table 'ejnwiki_user_properties' (localhost)"
# php update.php --conf /etc/mediawiki/LocalSettings.php MediaWiki 1.17.0 Updater Going to run database updates for wikidb-ejnwiki_ Depending on the size of your database this may take a while! Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0 ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...have user_real_name field in user table. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. ...have pagelinks; skipping old links table updates ...il_from OK ...have rc_ip field in recentchanges table. ...PRIMARY key already set on image table. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...have user_token field in user table. ...have wl_notificationtimestamp field in watchlist table. ...watchlist talk page rows already present ...user table does not contain user_emailauthenticationtimestamp field. ...page table already exists. ...have log_params field in logging table. ...logging table has correct log_title encoding. ...have ar_rev_id field in archive table. ...have page_len field in page table. ...revision table does not contain inverse_timestamp field. ...have rev_text_id field in revision table. ...have rev_deleted field in revision table. ...have img_width field in image table. ...have img_metadata field in image table. ...have user_email_token field in user table. ...have ar_text_id field in archive table. ...page_namespace is already a full int (int(11)). ...ar_namespace is already a full int (int(11)). ...rc_namespace is already a full int (int(11)). ...wl_namespace is already a full int (int(11)). ...qc_namespace is already a full int (int(11)). ...log_namespace is already a full int (int(11)). ...have img_media_type field in image table. ...already have pagelinks table. ...image table does not contain img_type field. ...already have unique user_name index. ...user_groups table exists and is in current format. ...have ss_total_pages field in site_stats table. ...user_newtalk table already exists. ...transcache table already exists. ...have iw_trans field in interwiki table. ...trackbacks table already exists. ...wl_notificationtimestamp is already nullable. ...times key already set on logging table. ...have ipb_range_start field in ipblocks table. ...no page_random rows needed to be set ...have user_registration field in user table. ...templatelinks table already exists ...externallinks table already exists. ...job table already exists. ...have ss_images field in site_stats table. ...langlinks table already exists. ...querycache_info table already exists. ...filearchive table already exists. ...have ipb_anon_only field in ipblocks table. ...rc_ns_usertext key already set on recentchanges table. ...rc_user_text key already set on recentchanges table. ...have user_newpass_time field in user table. ...redirect table already exists. ...querycachetwo table already exists. ...have ipb_enable_autoblock field in ipblocks table. ...index pl_namespace on table pagelinks includes field pl_from ...index tl_namespace on table templatelinks includes field tl_from ...index il_to on table imagelinks includes field il_from ...have rc_old_len field in recentchanges table. ...have user_editcount field in user table. ...page_restrictions table already exists. ...have log_id field in logging table. ...have rev_parent_id field in revision table. ...have pr_id field in page_restrictions table. ...have rev_len field in revision table. ...have rc_deleted field in recentchanges table. ...have log_deleted field in logging table. ...have ar_deleted field in archive table. ...have ipb_deleted field in ipblocks table. ...have fa_deleted field in filearchive table. ...have ar_len field in archive table. ...have ipb_block_email field in ipblocks table. ...index cl_sortkey on table categorylinks includes field cl_from ...have oi_metadata field in oldimage table. ...usertext_timestamp key already set on archive table. ...img_usertext_timestamp key already set on image table. ...oi_usertext_timestamp key already set on oldimage table. ...have ar_page_id field in archive table. ...have img_sha1 field in image table. ...protected_titles table already exists. ...have ipb_by_text field in ipblocks table. ...page_props table already exists. ...updatelog table already exists. ...category table already exists. ...category table already populated. ...have ar_parent_id field in archive table. ...have user_last_timestamp field in user_newtalk table. ...rev_parent_id column already populated. ...protected_titles table has correct pt_title encoding. ...have ss_active_users field in site_stats table. ...ss_active_users user count set... ...have ipb_allow_usertalk field in ipblocks table. ...pl_namespace, tl_namespace, il_to indices are already UNIQUE. ...change_tag table already exists. ...tag_summary table already exists. ...valid_tag table already exists. ...user_properties table already exists. Creating log_search table...ok Adding log_user_text field to table logging...A database query syntax error has occurred. The last attempted database query was: "ALTER TABLE `ejnwiki_logging` ADD log_user_text varchar(255) binary NOT NULL default , ADD log_page int unsigned NULL, CHANGE log_type log_type varbinary(32) NOT NULL, CHANGE log_action log_action varbinary(32) NOT NULL " from within function "DatabaseBase::sourceFile( /usr/share/mediawiki-1.17.0/maintenance/archives/patch-log_user_text.sql )". Database returned error "1142: ALTER command denied to user 'wikiuser'@'localhost' for table 'ejnwiki_logging' (localhost)"
Le message d'erreur indique donc la nécessité du privilège de modification de tables au niveau de la base de données. Ce privilège est accordé par la commande SQL suivante, sous Mysql:
mysql> GRANT ALTER ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 ROWS affected (0.00 sec)
#php update.php --conf /etc/mediawiki/LocalSettings.php MediaWiki 1.17.0 Updater Going to run database updates for wikidb-ejnwiki_ Depending on the size of your database this may take a while! Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0 ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...have user_real_name field in user table. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. ...have pagelinks; skipping old links table updates ...il_from OK ...have rc_ip field in recentchanges table. ...PRIMARY key already set on image table. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...have user_token field in user table. ...have wl_notificationtimestamp field in watchlist table. ...watchlist talk page rows already present ...user table does not contain user_emailauthenticationtimestamp field. ...page table already exists. ...have log_params field in logging table. ...logging table has correct log_title encoding. ...have ar_rev_id field in archive table. ...have page_len field in page table. ...revision table does not contain inverse_timestamp field. ...have rev_text_id field in revision table. ...have rev_deleted field in revision table. ...have img_width field in image table. ...have img_metadata field in image table. ...have user_email_token field in user table. ...have ar_text_id field in archive table. ...page_namespace is already a full int (int(11)). ...ar_namespace is already a full int (int(11)). ...rc_namespace is already a full int (int(11)). ...wl_namespace is already a full int (int(11)). ...qc_namespace is already a full int (int(11)). ...log_namespace is already a full int (int(11)). ...have img_media_type field in image table. ...already have pagelinks table. ...image table does not contain img_type field. ...already have unique user_name index. ...user_groups table exists and is in current format. ...have ss_total_pages field in site_stats table. ...user_newtalk table already exists. ...transcache table already exists. ...have iw_trans field in interwiki table. ...trackbacks table already exists. ...wl_notificationtimestamp is already nullable. ...times key already set on logging table. ...have ipb_range_start field in ipblocks table. ...no page_random rows needed to be set ...have user_registration field in user table. ...templatelinks table already exists ...externallinks table already exists. ...job table already exists. ...have ss_images field in site_stats table. ...langlinks table already exists. ...querycache_info table already exists. ...filearchive table already exists. ...have ipb_anon_only field in ipblocks table. ...rc_ns_usertext key already set on recentchanges table. ...rc_user_text key already set on recentchanges table. ...have user_newpass_time field in user table. ...redirect table already exists. ...querycachetwo table already exists. ...have ipb_enable_autoblock field in ipblocks table. ...index pl_namespace on table pagelinks includes field pl_from ...index tl_namespace on table templatelinks includes field tl_from ...index il_to on table imagelinks includes field il_from ...have rc_old_len field in recentchanges table. ...have user_editcount field in user table. ...page_restrictions table already exists. ...have log_id field in logging table. ...have rev_parent_id field in revision table. ...have pr_id field in page_restrictions table. ...have rev_len field in revision table. ...have rc_deleted field in recentchanges table. ...have log_deleted field in logging table. ...have ar_deleted field in archive table. ...have ipb_deleted field in ipblocks table. ...have fa_deleted field in filearchive table. ...have ar_len field in archive table. ...have ipb_block_email field in ipblocks table. ...index cl_sortkey on table categorylinks includes field cl_from ...have oi_metadata field in oldimage table. ...usertext_timestamp key already set on archive table. ...img_usertext_timestamp key already set on image table. ...oi_usertext_timestamp key already set on oldimage table. ...have ar_page_id field in archive table. ...have img_sha1 field in image table. ...protected_titles table already exists. ...have ipb_by_text field in ipblocks table. ...page_props table already exists. ...updatelog table already exists. ...category table already exists. ...category table already populated. ...have ar_parent_id field in archive table. ...have user_last_timestamp field in user_newtalk table. ...rev_parent_id column already populated. ...protected_titles table has correct pt_title encoding. ...have ss_active_users field in site_stats table. ...ss_active_users user count set... ...have ipb_allow_usertalk field in ipblocks table. ...pl_namespace, tl_namespace, il_to indices are already UNIQUE. ...change_tag table already exists. ...tag_summary table already exists. ...valid_tag table already exists. ...user_properties table already exists. ...log_search table already exists. Adding log_user_text field to table logging...ok Populating log_user_text field, printing progress markers. For large databases, you may want to hit Ctrl-C and do this manually with maintenance/populateLogUsertext.php. ...doing log_id from 1 to 100 ...doing log_id from 101 to 200 ...doing log_id from 201 to 300 ...doing log_id from 301 to 400 ...doing log_id from 401 to 500 ...doing log_id from 501 to 600 ...doing log_id from 601 to 700 ...doing log_id from 701 to 800 ...doing log_id from 801 to 900 ...doing log_id from 901 to 1000 log_usertext population complete. Done populating log_user_text field. Populating log_search table, printing progress markers. For large databases, you may want to hit Ctrl-C and do this manually with maintenance/populateLogSearch.php. ...doing log_id from 1 to 100 ...doing log_id from 101 to 200 ...doing log_id from 201 to 300 ...doing log_id from 301 to 400 ...doing log_id from 401 to 500 ...doing log_id from 501 to 600 ...doing log_id from 601 to 700 ...doing log_id from 701 to 800 ...doing log_id from 801 to 900 ...doing log_id from 901 to 1000 log_search population complete. Done populating log_search table. Creating l10n_cache table...ok Creating external_user table...ok ...ls_field_val key already set on log_search table. ...change_tag_rc_tag key already set on change_tag table. Adding rd_interwiki field to table redirect...ok Converting tc_time from UNIX epoch to MediaWiki timestamp... ok ...eu_wiki_id already renamed to eu_local_id. Altering all *_mime_minor fields to 100 bytes in size ... done. Populating rev_len column ...doing rev_id from 1 to 200 ...doing rev_id from 201 to 400 ...doing rev_id from 401 to 600 ...doing rev_id from 601 to 800 ...doing rev_id from 801 to 1000 ...doing rev_id from 1001 to 1200 ...doing rev_id from 1201 to 1400 ...doing rev_id from 1401 to 1600 ...doing rev_id from 1601 to 1800 ...doing rev_id from 1801 to 2000 ...doing rev_id from 2001 to 2200 ...doing rev_id from 2201 to 2400 ...doing rev_id from 2401 to 2600 rev_len population complete ... 0 rows changed (0 missing) Creating iwlinks table...ok ...iwl_prefix_title_from key already set on iwlinks table. Adding ul_value field to table updatelog...ok Adding iw_api field to table interwiki...ok ...iwl_prefix key doesn't exist. ...iwl_prefix_from_title key doesn't exist. Adding cl_collation field to table categorylinks...ok ...categorylinks up-to-date. Fixing collation for 828 rows. Processing next 50 rows... 50 done. Processing next 50 rows... 100 done. Processing next 50 rows... 150 done. Processing next 50 rows... 200 done. Processing next 50 rows... 250 done. Processing next 50 rows... 300 done. Processing next 50 rows... 350 done. Processing next 50 rows... 400 done. Processing next 50 rows... 450 done. Processing next 50 rows... 500 done. Processing next 50 rows... 550 done. Processing next 50 rows... 600 done. Processing next 50 rows... 650 done. Processing next 50 rows... 700 done. Processing next 50 rows... 750 done. Processing next 50 rows... 800 done. Processing next 50 rows... 828 done. Creating msg_resource table...ok Creating module_deps table...ok ...ar_page_revid key doesn't exist. Adding ar_revid key to table archive... ok ...ll_lang is up-to-date. Purging caches...done. Checking site_stats row...done. Checking existence of old default messages...done. Done.
La 6ème tentative a donc été la bonne. Des droits ont été accordés sur le compte d'accès à la base de données. Mais ils ne sont pas nécessaires pour le bon fonctionnement du Wiki. Ils sont donc supprimés:
mysql> REVOKE CREATE ON wikidb.* FROM 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> REVOKE ALTER ON wikidb.* FROM 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> REVOKE INDEX ON wikidb.* FROM 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 ROWS affected (0.00 sec)
Mise à jour configuration Apache
La base étant mise à jour, il est donc nécessaire de modifier la configuration Apache, voir Publication sous Apache, pour pointer sur la nouvelle instance. Le fichier de configuration se trouve à l'emplacement /etc/mediawiki/apache.conf
est les emplacements sont modifiés ainsi:
# Uncomment this to add an alias.
# This does not work properly with virtual hosts..
Alias /wiki /var/lib/mediawiki-1.17.0
<Directory /var/lib/mediawiki_1.17.0/>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>
# some directories must be protected
<Directory /var/lib/mediawiki-1.17.0/config>
Options -FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/lib/mediawiki_1.17.0/upload>
Options -FollowSymLinks
AllowOverride None
</Directory>
Sécurité des fichiers
Pour un peu plus de sécurité sur le serveur, les droits d'accès sur les fichiers installés sont modifiés ainsi:
#sudo chown -R www-data:www-data /var/lib/mediawiki-1.17.0