Manual:DumpBackup.php/tr

Category:MediaWiki code/tr#DumpBackup.php

Ayrıntılar

dumpBackup.php dosyası, dışa aktarma veya yedekleme için bir XML dökümü oluşturur. XML dökümleri, siteyle ilgili veriler olmadan viki içeriğini (tüm düzeltmeleriyle birlikte viki sayfaları) içerir. DumpBackup.php, viki veritabanının tam bir yedeğini oluşturmaz, döküm, kullanıcı hesaplarını, resimlerini, düzenleme günlüklerini, silinmiş revizyonları vb. içermez.[1] Döküm tamamlandıktan sonra, XML dökümünü içe aktarabilirsiniz.

Örnekler

Genel örnekler

Veri dökümü için bir ad seçmelisiniz.

Örneğin, buradaki kullanıcı tüm revizyon geçmişini (--full) --full adlı bir dosyaya kaydediyor:

php dumpBackup.php --full > pagedump.xml

You can also include the uploaded files by doing:

php dumpBackup.php --full --include-files --uploads > page-and-filedump.xml
Bu dump.xml örneğiyle ilgili daha fazla ayrıntı için aşağıdaki Ayrıntılı örnek bölümüne bakın.

Veri dökümünü bir ad alanı ile sınırlayabilirsiniz. Bu örnekte yalnızca mevcut revizyonlarına sahip şablonlar vardır:

php dumpBackup.php --current --quiet --filter=namespace:10 > templates.xml

veya tüm revizyonlarıyla birlikte şablonlar:

php dumpBackup.php --full --quiet --filter=namespace:10 > templates.xml

Birden çok ad alanı eklemek için:

php dumpBackup.php --current --quiet --filter=namespace:10,11 > templates_plus_template_talk.xml

To also include files when filtering by certain namespaces:

php dumpBackup.php --current --quiet --filter=namespace:0,1,6 --include-files --uploads > main_plus_talk_plus_files.xml

Bir eklentinin örnek kullanımı:

php dumpBackup.php \
  --plugin=AbstractFilter:extensions/ActiveAbstract/AbstractFilter.php \
  --current \
  --output=gzip:/dumps/abstract.xml.gz \
  --filter=namespace:NS_MAIN \
  --filter=noredirect \
  --filter=abstract \
  --quiet

veya

php dumpBackup.php \
  --plugin=MathMLFilter:../extensions/MathSearch/maintenance/MathMLFilter.php \
  --current \
  --filter=namespace:NS_MAIN \
  --filter=mathml \
  --quiet

--stub seçeneği dumpTextPass.php ile kullanılabilir.

--include-files ile:

php dumpBackup.php \
  --full \
  --include-files \
  --uploads \
  --output=gzip:/dumps/abstract.xml.gz \
  --quiet

--uploads seçeneğinin de kullanılması gerekir. Aksi takdirde dosya dahil edilmeyecektir.

Ayrıntılı örnek

Bu örnekte, Yeşil metin, yazdığınız metindir.

  1. cd komutunu kullanarak bakım klasörüne yeniden yönlendirin. Bakım klasörünüzün konumu bu örnekten farklı olacaktır.
  2. php dumpBackup.php --full > /var/tmp/dump.xml yazın ve enter tuşuna basın. Aşağıdaki örneğe benzer şekilde uzun bir kod listesi oluşturulur.

user@server:/$ cd /var/www/html/wiki/w/maintenance

user@server:/var/www/html/wiki/w/maintenance$ php dumpBackup.php --full > /var/tmp/dump.xml

2014-08-15 09:54:08: my_wiki-finddcjobs (ID 23578) 0 pages (0.0|0.0/sec all|curr), 100 revs (404.7|404.7/sec all|curr), ETA 2014-08-15 09:54:11 [max 1143]

2014-08-15 09:54:08: my_wiki-finddcjobs (ID 23578) 0 pages (0.0|0.0/sec all|curr), 200 revs (499.7|652.8/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:08: my_wiki-finddcjobs (ID 23578) 10 pages (19.2|83.8/sec all|curr), 300 revs (577.4|838.3/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:08: my_wiki-finddcjobs (ID 23578) 17 pages (24.1|91.4/sec all|curr), 400 revs (567.0|537.9/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:09: my_wiki-finddcjobs (ID 23578) 18 pages (15.6|40.2/sec all|curr), 500 revs (433.4|223.1/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:09: my_wiki-finddcjobs (ID 23578) 23 pages (15.4|66.8/sec all|curr), 600 revs (400.6|290.5/sec all|curr), ETA 2014-08-15 09:54:11 [max 1143]

2014-08-15 09:54:09: my_wiki-finddcjobs (ID 23578) 59 pages (36.0|412.4/sec all|curr), 700 revs (426.6|699.0/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:09: my_wiki-finddcjobs (ID 23578) 62 pages (36.2|856.3/sec all|curr), 800 revs (466.9|1381.2/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:10: my_wiki-finddcjobs (ID 23578) 89 pages (48.8|798.3/sec all|curr), 900 revs (493.2|896.9/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:10: my_wiki-finddcjobs (ID 23578) 120 pages (62.4|1224.2/sec all|curr), 1000 revs (520.1|1020.2/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

2014-08-15 09:54:10: my_wiki-finddcjobs (ID 23578) 124 pages (59.0|697.5/sec all|curr), 1100 revs (523.7|562.5/sec all|curr), ETA 2014-08-15 09:54:10 [max 1143]

user@server:/var/www/html/wiki/w/maintenance$

Yeni xml dosyası bakım klasöründe oluşturulacaktır (xml dosyasını görmek için SCP'nizi yenilemeniz gerekebilir).

Seçenekler

As of MediaWiki 1.43.x:

$ php maintenance/run.php dumpBackup --help

This script dumps the wiki page or logging database into an
XML interchange wrapper format for export or backup.

XML output is sent to stdout; progress reports are sent to stderr.

WARNING: this is not a full database dump! It is merely for public export
         of your wiki. For full backup, see our online help at:
         https://www.mediawiki.org/wiki/Backup

Usage: php maintenance/run.php dumpBackup [OPTION]...

Script runner options:
    --conf <CONF>: Location of LocalSettings.php, if not default
    --globals: Output globals at the end of processing for debugging
    --help (-h): Display this help message
    --memory-limit <MEMORY-LIMIT>: Set a specific memory limit for the
        script, "max" for no limit or "default" to avoid changing it
    --profiler <PROFILER>: Profiler output format (usually "text")
    --quiet (-q): Whether to suppress non-error output
    --server <SERVER>: The protocol and server name to use in URLs, e.g.
        https://en.wikipedia.org. This is sometimes necessary because server
        name detection may fail in command line scripts.
    --wiki <WIKI>: For specifying the wiki ID

Common options:
    --dbgroupdefault <DBGROUPDEFAULT>: The default DB group to use.
    --dbpass <DBPASS>: The password to use for this script
    --dbuser <DBUSER>: The DB user to use for this script

Script specific options:
    --7ziplevel <7ZIPLEVEL>: 7zip compression level for all 7zip
        outputs. Used for -mx option to 7za command.
    --current: Dump only the latest revision of every page.
    --end <END>: Stop before page_id or log_id n (exclusive)
    --filter <FILTER>: Add a filter on an output branch. Specify as
        <type>[:<options>]. <types>s: latest, notalk, namespace
    --full: Dump all revisions of every page
    --include-files: Include files within the XML stream
    --logs: Dump all log events
    --namespaces: Limit to this comma-separated list of namespace
        numbers
    --orderrevs: Dump revisions in ascending revision order (implies
        dump of a range of pages)
    --output (-o) <OUTPUT (-O)>: Begin a filtered output stream; Specify
        as <type>:<file>. <type>s: file, gzip, bzip2, 7zip, dbzip2, lbzip2
    --pagelist <PAGELIST>: Dump only pages included in the file
    --plugin <PLUGIN>: Load a dump plugin class. Specify as
        <class>[:<file>].
    --report <REPORT>: Report position and speed after every n pages
        processed. Default: 100.
    --revend <REVEND>: Stop before rev_id n (exclusive)
    --revrange: Dump range of revisions specified by revstart and revend
        parameters
    --revstart <REVSTART>: Start from rev_id
    --schema-version <SCHEMA-VERSION>: Schema version to use for output.
        Default: 0.11
    --skip-footer: Don't output the </mediawiki> footer
    --skip-header: Don't output the <mediawiki> header
    --stable: Dump stable versions of pages
    --start <START>: Start from page_id or log_id
    --stub: Don't perform old_text lookups; for 2-pass dump
    --uploads: Include upload records without files

Bu betik, normalde LocalSettings.php içinde ayarlanan $wgDBadminuser ve $wgDBadminpassword tarafından tanımlanan kullanıcı adı ve parolayı kullanarak veritabanına bağlanır. Genellikle $wgDBadminuser, $wgDBuser olarak daha fazla ayrıcalığa sahip bir kullanıcıdır, ancak dumpBackup.php ile çalıştırmak için ekstra ayrıcalıklara gerek yoktur, bu nedenle kullanıcı adları ve parolalar aynı olabilir. Değişkenler ayarlanmadıysa, veritabanına bağlanmaya çalışırken dumpBackup.php başarısız olacaktır:

$ php dumpBackup.php --full
DB connection error: Unknown error


Notlar

XML dosyası standart çıkış (stdout) üzerine gönderilir; ilerleme raporları standart hataya (stderr) gönderilir. Bunlar, varsayılan çıkış ve hatalar için çıkış aygıtıdır. Betiğini kabuktan çağırdığınızda, her iki çıkışının da varsayılan olarak kabuğa gönderilmesi gerekir, yani: "Bilgilendirici" çıkış ve hataları doğrudan ekranda görmelisiniz.

Hata mesajları

Doğru klasörde değilseniz, bu mesajı alacaksınız:

No input file specified.

DumpBackup betiği, "--report" sonraki parametre 0 veya sayı değil olarak değerlendirildiğinde "Uyarı: [DİZİN]/maintenance/backup.inc içinde sıfıra böl" diyor. Düzeltme, dumpBackup ile "--report" seçeneği olmadan çalıştırmaktır; daha sonra dumpBackup, işlenen her 100 sayfada bir durum satırı yazdırır.

Önerilen yapılandırma ayarları

  • Tüm revizyonların nesne önbelleğine eklenmesini önlemek için $wgRevisionCacheExpiry , 0 olarak ayarlanmalıdır. Okuyucularınız normalde vikinizdeki sayfaların rastgele eski revizyonlarını görmeyeceği için bunların çoğu önbellekte saklanmaktan yararlanamayacaktır.

Ayrıca bakınız

Kaynakça

  1. DumpBackup.php, bir XML değişim sarmalayıcısı oluşturur.
Category:Maintenance scripts/tr#DumpBackup.php Category:Import/Export/tr
Category:Import/Export/tr Category:Maintenance scripts/tr Category:MediaWiki code/tr