Manual:copyJobQueue.php
Appearance
MediaWiki version: | ≥ 1.22 |
MediaWiki file: copyJobQueue.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.42.4 • 1.41.5 • 1.39.11 |
Classes: | CopyJobQueue |
Details
[edit]copyJobQueue.php file is a maintenance script to copy all jobs from one job queue system to another.
This script requires setting $wgJobQueueMigrationConfig
before running. This script processes 500 items in a batch.
The $wgJobQueueMigrationConfig
configuration variable consists of keys with array values. These array values are passed to JobQueue::factory()
.
The parameters in the array should not have wiki
or type
settings as it will be injected by script itself.
$wgJobQueueMigrationConfig = [
'db' => [
'class' => 'JobQueueDB',
'idGenerator' => 'uniqueId1'
],
'redis' => [
'class' => 'JobQueueRedis',
'redisServer' => 'localhost',
'redisConfig' => [ 'connectTimeout' => 1 ],
'idGenerator' => 'uniqueId2'
]
];
Options/Arguments
[edit]Option | Description | Required? |
---|---|---|
--src | Key to $wgJobQueueMigrationConfig for source | Required |
--dst | Key to $wgJobQueueMigrationConfig for destination | Required |
--type | Types of jobs to copy (use "all" for all) | Required |
Usage
[edit]php maintenance/run.php copyJobQueue --src scrKey --dst dstKey --type jobType
Terminal
$ php maintenance/run.php copyJobQueue --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.
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.