Manual:copyJobQueue.php
From Linux Web Expert
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.22
<translate> MediaWiki version:</translate> |
Fichier MediaWiki : copyJobQueue.php | |
---|---|
Emplacement : | maintenance/ |
Code source : | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes : | CopyJobQueue |
Détails
Le fichier copyJobQueue.php est un script de maintenance pour copier toutes les tâches d'une file de tâches à une autre.
Ce script nécessite d'initialiser $wgJobQueueMigrationConfig
avant de l'exécuter. Ce script traite 500 éléments par paquet.
La variable de configuration $wgJobQueueMigrationConfig
est constituée de clés avec des valeurs de tableau. Ces valeurs de tableau sont transmises à JobQueue::factory()
Les paramètres dans le tableau ne devraient pas avoir les paramètres wiki
ou type
comme ils sont définis par le script lui-même.
$wgJobQueueMigrationConfig = [
'db' => [
'class' => 'JobQueueDB',
'idGenerator' => 'uniqueId1'
],
'redis' => [
'class' => 'JobQueueRedis',
'redisServer' => 'localhost',
'redisConfig' => [ 'connectTimeout' => 1 ],
'idGenerator' => 'uniqueId2'
]
];
Options et arguments
Option | Description | Required? |
---|---|---|
--src | Key to $wgJobQueueMigrationConfig for source | <translate> Required</translate> |
--dst | Key to $wgJobQueueMigrationConfig for destination | <translate> Required</translate> |
--type | Types of jobs to copy (use "all" for all) | <translate> Required</translate> |
Utilisation
php maintenance/copyJobQueue.php --src scrKey --dst dstKey --type jobType
Terminal
$ php maintenance/copyJobQueue.php --src db --dst redis --type all Copied 4/5 queued InitImageDataJob jobs. Copied 1/5 delayed InitImageDataJob jobs. Copied 0/0 queued createPdfThumbnailsJob jobs. Copied 0/0 delayed createPdfThumbnailsJob jobs. Copied 13/15 queued renameUser jobs. Copied 1/15 delayed renameUser jobs. Copied 0/0 queued replaceText jobs. Copied 0/0 delayed replaceText jobs. Copied 0/0 queued deletePage jobs. Copied 0/0 delayed deletePage jobs. Copied 0/0 queued refreshLinks jobs. Copied 0/0 delayed refreshLinks jobs. Copied 0/0 queued deleteLinks jobs. Copied 0/0 delayed deleteLinks jobs. Copied 0/0 queued htmlCacheUpdate jobs. Copied 0/0 delayed htmlCacheUpdate jobs. Copied 0/0 queued sendMail jobs. Copied 0/0 delayed sendMail jobs. Copied 0/0 queued enotifNotify jobs. Copied 0/0 delayed enotifNotify jobs. Copied 0/0 queued fixDoubleRedirect jobs. Copied 0/0 delayed fixDoubleRedirect jobs. Copied 0/0 queued AssembleUploadChunks jobs. Copied 0/0 delayed AssembleUploadChunks jobs. Copied 0/0 queued PublishStashedFile jobs. Copied 0/0 delayed PublishStashedFile jobs. Copied 0/0 queued ThumbnailRender jobs. Copied 0/0 delayed ThumbnailRender jobs. Copied 0/0 queued recentChangesUpdate jobs. Copied 0/0 delayed recentChangesUpdate jobs. Copied 0/0 queued refreshLinksPrioritized jobs. Copied 0/0 delayed refreshLinksPrioritized jobs. Copied 0/0 queued refreshLinksDynamic jobs. Copied 0/0 delayed refreshLinksDynamic jobs. Copied 0/0 queued activityUpdateJob jobs. Copied 0/0 delayed activityUpdateJob jobs. Copied 0/0 queued categoryMembershipChange jobs. Copied 0/0 delayed categoryMembershipChange jobs. Copied 0/0 queued clearUserWatchlist jobs. Copied 0/0 delayed clearUserWatchlist jobs. Copied 0/0 queued watchlistExpiry jobs. Copied 0/0 delayed watchlistExpiry jobs. Copied 0/0 queued cdnPurge jobs. Copied 0/0 delayed cdnPurge jobs. Copied 0/0 queued userGroupExpiry jobs. Copied 0/0 delayed userGroupExpiry jobs. Copied 0/0 queued clearWatchlistNotifications jobs. Copied 0/0 delayed clearWatchlistNotifications jobs. Copied 0/0 queued userOptionsUpdate jobs. Copied 0/0 delayed userOptionsUpdate jobs. Copied 0/0 queued revertedTagUpdate jobs. Copied 0/0 delayed revertedTagUpdate jobs. Copied 0/0 queued enqueue jobs. Copied 0/0 delayed enqueue jobs. Copied 0/0 queued null jobs. Copied 0/0 delayed null jobs. Copied 0/0 queued userEditCountInit jobs. Copied 0/0 delayed userEditCountInit jobs.