Sponsored Links

does anyone know about wiki backup and xml export automation?

timeless

ULTIMATE Member
Staff member
Volunteer Mod
pretty much what the title says, lm looking for any information on how to automate both database backup and xml exports so that l dont have to touch the wiki lm helping out on.

due to how large the db is l cant get a script to do it as it always heads to 500 errors...
 
I don't know what controls editors have over Wiki's so can't help, but doing automated backups of server (SQL, MySQL, MSSQL etc.) style databases is a piece of cake through cronjobs.
 
Sponsored Links
trouble is this xml based export is annoying the hell outta be, theres this script which l finally found that is called dumpBackup.php which one has to run like so through ssh:

php dumpBackup.php <action> <option>

but the annoying thing is l get the action but all it does is show me the whole wiki and not do any backup action...
 
Here's a web-based PHP script method for MySQL that I did for emergencies when SSH is down or Cron's aren't working:

PHP:
<?php
  $host= 'localhost';
  $user= 'XXXXXX';
  $pass= 'XXXXXX';
  $db=   'XXXXXX';
  system(sprintf(
    'mysqldump --opt -h %s -u %s -p%s %s | gzip > %s/dump.sql.gz',
    $host,
    $user,
    $pass,
    $db,
    getenv('DOCUMENT_ROOT')
  ));
  echo '+DONE';
?>
 
neat, on another note after allot of trial and error l have got the dumpBackup.php working which is a supported addon for media wiki located here What we did was work out the commands "finally" as wiki staff were no help at all.. you just need to make sure that the AdminSettings.php is edited with you database username and password and that the dumpBackup.php is stored within the maintenance directory

then we wrote a script to automate those commands


Code:
#!/bin/sh
###########
#variables#
###########
timestamp=`date +%Y-%m-%d`
#path to maintenance directory
wikipath=/path/to/wiki/maintenance/directory/
#path to images dir
imagepath=/path/to/wiki/images/directory/
#path to save backups to
outputpath=/path/to/output/directory/
#current backup name
current=name.current
#full backup name
full=name.full
#image backup name
image=name.images
########################
#Do Not Edit Below Here#
########################
echo "creating Curent XML dump, please wait"
php -d error_reporting=E_ERROR $wikipath/dumpBackup.php --current  --quiet --output=gzip:$outputpath$current.$timestamp.xml.gz || exit $?
echo "done"
echo "creating Full XML dump, please wait"
php -d error_reporting=E_ERROR $wikipath/dumpBackup.php --full  --quiet --output=gzip:$outputpath$full.$timestamp.xml.gz || exit $?
echo "done"
#echo "creating image dump, please wait"
#cd $imagepath
#tar --create $outputpath$image.tgz || exit $?
#echo "done"
echo "sending email to user"
echo "A new XML backup of your Wiki is available to download from http://site.com/wiki_xml" | mail -s "New Wiki XML Backup Available" user@mail.com
echo "sending email to Ai"
echo "XML Wiki Backup completed successfully" | mail -s "New XML Backup Available" user@mail.com
echo "Backup Completed, any errors reported above"
#######
# END #
#######

basically this shell script needs to be run from root, added into the crontabs file, it exports the wiki xmls full and current edits and also tarballs the images directory for later download by the wiki owner (the person we host the wiki for annoyingly complies with wikia he seems to want to have backups publicly available to all weekly) in any case for the user who knows what he is doing its easy to see the variables needed to change to edit for their own use.
 
Top
Cheap BIG ISPs for 100Mbps+
Community Fibre UK ISP Logo
150Mbps
Gift: None
Virgin Media UK ISP Logo
Virgin Media £26.00
132Mbps
Gift: None
Shell Energy UK ISP Logo
Shell Energy £26.99
109Mbps
Gift: None
Plusnet UK ISP Logo
Plusnet £27.99
145Mbps
Gift: None
Zen Internet UK ISP Logo
Zen Internet £28.00 - 35.00
100Mbps
Gift: None
Large Availability | View All
Cheapest ISPs for 100Mbps+
Gigaclear UK ISP Logo
Gigaclear £17.00
200Mbps
Gift: None
YouFibre UK ISP Logo
YouFibre £19.99
150Mbps
Gift: None
Community Fibre UK ISP Logo
150Mbps
Gift: None
BeFibre UK ISP Logo
BeFibre £21.00
150Mbps
Gift: £25 Love2Shop Card
Hey! Broadband UK ISP Logo
150Mbps
Gift: None
Large Availability | View All

Helpful ISP Guides and Tips

Sponsored Links
The Top 15 Category Tags
  1. FTTP (5513)
  2. BT (3514)
  3. Politics (2535)
  4. Openreach (2297)
  5. Business (2261)
  6. Building Digital UK (2243)
  7. FTTC (2043)
  8. Mobile Broadband (1972)
  9. Statistics (1788)
  10. 4G (1663)
  11. Virgin Media (1619)
  12. Ofcom Regulation (1460)
  13. Fibre Optic (1394)
  14. Wireless Internet (1389)
  15. FTTH (1381)
Sponsored

Copyright © 1999 to Present - ISPreview.co.uk - All Rights Reserved - Terms  ,  Privacy and Cookie Policy  ,  Links  ,  Website Rules