Jump to content

Manual talk:DumpBackup.php

Add topic
From mediawiki.org
Latest comment: 17 days ago by Mshastchi in topic Extracting the content of a damaged database

Questions

[edit]

  • I have multiple wiki in the same database but different table. How do I specify which wiki to dump.
    • If you've soft linked one wiki installation's maintenance or includes to the other, the backup script will use the settings from wherever the files actually are, thus disregarding any table prefix you've set in the second installation's LocalSettings. I blew away the soft-linked maintenance and includes and copied the real ones in, and then the backup script used the proper LocalSettings. —alxndr (t) 23:45, 9 July 2009 (UTC)Reply
  • I'm getting this error: This script must be run from the command line --74.14.57.223 23:30, 16 October 2008 (UTC)Reply
  • What's the command for dumping to a specific file in linux? — Preceding unsigned comment added by 203.59.181.26 (talkcontribs)
php dumpBackup.php > out.xmlEmufarmers(T|C) 16:49, 14 February 2009 (UTC)Reply
  • I'm running on Windows and PHP5. My database seems to be working fine. Any ideas? This is my command and error:
Command) C:\Program Files\PHP5>php -q "C:\Program Files\Abyss Web Server\htdocs\wikismith\maintenance\dumpBackup.php" --full --report
Error) DB connection error: Unknown error

Nevermind, I didn't have an AdminSetting.php setup.

Warning - division by zero - will it cause problems?

[edit]

While dumping a wiki, the following are the last two lines of the dump:

Warning: Division by zero in [DIRECTORY]/maintenance/backup.inc on line 267 2009-06-10 14:14:18: wikademia_ 10206 pages (92.738/sec), 59922 revs (544.487/sec), ETA 2009-06-10 14:14:20 [max 61176] Warning: Division by zero in [DIRECTORY]/maintenance/backup.inc on line 267

The whole "Warning: Division by zero in..." can that cause problems? Is there a known fix? Thank you. Wikademia

dunno how to quote, but problem is this. you have --report with no =n. a look at the file in question shows that there is no check if you provide the --report flag without supplying an option. omit this flag.

Thank you, anonymous commenter. I confirm that running "dumpBackup" without the "--report" option fixes this error (and still reports at the default number of pages). Assuming that Wikademia and I are not the only people hitting this warning, I mentioned it in the Manual:DumpBackup.php#Error_messages section. --DavidCary (talk) 14:47, 3 February 2014 (UTC)Reply

Full doesn't get logs, and vice versa?

[edit]

I am confused by the --full and --logs flag in the dumpBackup.php file. The full backup doesn't appear to grab the logs, and the logs flag obviously doesn't get the full. Do I need to run both of these on seperate dumps? Or should I just be on the safe side and run 3 dumps and tarball them up. --Urda 16:07, 12 March 2010 (UTC)Reply

Error message

[edit]
<br />
<b>Parse error</b>:  syntax error, unexpected ':', expecting '(' in <b>/home/content/c/2/o/c/html/maintenance/dumpBackup.php</b> on line <b>60</b><br />

Error line 60:

$textMode = isset( $options['stub'] ) ? WikiExporter::STUB : WikiExporter::TEXT;</nowiki>

Adamtheclown 02:32, 20 December 2010 (UTC)Reply

I fixed this issue by using php5. 24.226.34.199 23:57, 20 May 2011 (UTC)Reply

Backup for farms

[edit]

For backing up wiki familiys I wrote this tiny script dumpBackup_farm.php.

<?php
// Backup script for wiki farms by Marco Bakera

$_SERVER['REQUEST_URI'] = "/".$argv[1];

// print_r($argv);

// remove first argument
unset($argv[1]);
// reindex array
$argv = array_values($argv);


//print_r($argv);

// run the default backup script
include("dumpBackup.php");

For instance, when invoked with php dumpBackup_farm.php wiki42 --full it creates a full backup of wiki42. This works for family wikis as created in Scenario 2.

Where is stdout and stderr?

[edit]

The XML file is sent to standard output (stdout); progress reports are sent to standard error (stderr)? Thewhitebox (talk) 10:21, 15 August 2014 (UTC)Reply

answered at Thread:Project:Support desk/Where is stdout and stderr? Thewhitebox (talk) 01:13, 16 August 2014 (UTC)Reply
dump.xml file created in the maintenance folder.

my MySQL database is not on a standard port

[edit]

My web-space and database provider told me to

  • either connect to my database on TCP/IP Port 5754
  • or to use a dedicated socket:
$ mysql -S mysql/mysql.sock -u root -p mysql

How do I direct DumpBackup.php to follow that instruction?

Not working

[edit]

I have a 7 year old wiki whose OS is at the end of life and it is causing problems. I am trying to dump the wiki so I can import it into a a fresh install on a modern long term support OS.

My current versions are:

MediaWiki 	1.15.0
PHP 	5.2.10-2ubuntu6.10 (apache2handler)
MySQL 	5.1.37-1ubuntu5.5-log

and it is running on an old squeeze/sid debian system.

This is what happens:

root@wiki:/var/lib/mediawiki# php maintenance/dumpBackup.php --full 
This wiki is not available. Check configuration.root@wiki:/var/lib/mediawiki# 

My AdminSettings.php is setup like so(username and password removed here obviously):

$wgDBadminuser      = 'username';
$wgDBadminpassword  = 'password';

Can someone give me a hint as to what I am doing wrong? Is it a problem with the software or the guy trying to use it? Chillum (talk) 18:12, 19 February 2015 (UTC)Reply

variables wgDBadminuser still needed?

[edit]

If the variables are not set, dumpBackup.php will fail when trying to connect to the database

mine seems to work fine, so are is there a fall back if $wgDBadminuser and $wgDBadminpassword is not set to $wgDBuser ?

TiloWiki (talk) 16:51, 8 August 2018 (UTC)Reply

  • Just wanted to add a comment on this - I tried to do (in 2019) a backup of an older MediaWiki, but such that the php installation was on one server, and the MySQL server on a different one entirely. In my LocalSettings.php, I did NOT have $wgDBadminuser and $wgDBadminpassword defined, and running php maintenance/dumpBackup.php failed with DB connection error: Access denied for user 'SERVERONE\user'@'[ipaddress]' (using password: NO). Only after I added the lines $wgDBadminuser = $wgDBuser; and $wgDBadminpassword = $wgDBpassword; to LocalSettings.php, the command php maintenance/dumpBackup.php completed.
[edit]

Does this mean that before running the script, one should temporarily modify $wgRevisionCacheExpiry in LocalSettings.php? If yes, should the page make that clear?

Extracting the content of a damaged database

[edit]

I am trying to extract the text of the articles from a damaged database. My database does not have users table and other last tables (in alphabetical order) i.e. user, user_autocreate_serial, user_former_groups, user_groups, user_newtalk, user_properties, watchlist, watchlist_expiry. I don't care about the user now, I just want the current text of articles attributed to mediawiki default user. Is there a way to do that? Mshastchi (talk) 03:59, 1 November 2024 (UTC)Reply