Manual:migrateFileRepoLayout.php
Appearance
| MediaWiki ファイル: migrateFileRepoLayout.php | |
|---|---|
| 場所: | maintenance/ |
| ソース コード: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| クラス: | MigrateFileRepoLayout |
詳細
migrateFileRepoLayout.php is a maintenance script that copies all files in FileRepo to a new layout using SHA1 paths.
オプション
| オプション | 説明 | 必須かどうか |
|---|---|---|
| --oldlayout | Old layout; one of 'name' or 'sha1' | 必須 |
| --newlayout | New layout; one of 'name' or 'sha1' | 必須 |
| --since | Copy only files from after this timestamp | 省略可能 |
This script runs in batches of 50.
使用法
php maintenance/run.php migrateFileRepoLayout --oldlayout name|sha1 --newlayout name|sha1 [ --since ]
Terminal
$ php maintenance/run.php migrateFileRepoLayout --oldlayout name --newlayout sha1
Migrating file batch:
"1631330937964.jpeg" (dest: mwstore://local-backend/local-original/o/5/0/o50kk2gmida2gmaxbp19qzdhhfosovz)
"Example_Main_Page.png" (dest: mwstore://local-backend/local-original/0/u/n/0unk5fuzx7s2qeic2hxtp73pk1yeln6)
"Logo.jpg" (dest: mwstore://local-backend/local-original/a/x/r/axrt73dk8q1r1xw5zmn819w5ybriclx)
Array
(
[0] => Array
(
[type] => error
[message] => lockmanager-fail-openlock
[params] => Array
(
[0] => mwstore://local-backend/local-public/8/8a/764634234.jpeg
)
)
)
Batch done
Done (started 20211028042818)
MediaWiki バージョン 1.39.15 以前では、メンテナンス スクリプトを
php maintenance/run.php スクリプト名 ではなく php maintenance/スクリプト名.php を使用して実行する必要があります。
よくあるエラー
- Invalid old layout.
The value for parameter --oldlayout must be either name or sha1.
- Invalid new layout.
The value for parameter --newlayout must be either name or sha1.