Redbrick Wiki:Maintenance: Difference between revisions
m (First draft, some headings but no content yet) |
mNo edit summary |
||
Line 1: | Line 1: | ||
I'm going to use this topic as a place to hold information about maintaining this wiki. Like [[Help:Contents]] it may split up into other smaller articles. | I'm going to use this topic as a place to hold information about maintaining this wiki. Like [[Help:Contents]] it may split up into other smaller articles. | ||
==Creating | ==Creating Backups== | ||
If you login into [http://www.redbrick.dcu.ie Redbrick] as the User [[User:Wiki|Wiki]] you can execute a simple script I wrote called 'wiki_backup'. This dumps the SQL and tar.gz public_html and the wiki home directory and places it in /var/tmp for downloading using SFTP. The only reason the wiki home directory is tar.gz is that TWiki used to store some stuff there. | |||
I've blanked the password out in the script example below. | |||
#!/bin/sh | |||
BKUPDIR=/var/tmp/wiki | |||
BKUPNAME=`date +%Y-%m-%d`RedbrickWiki | |||
BKUP=${BKUPDIR}/${BKUPNAME} | |||
BKUPAC=${BKUPDIR}/${BKUPNAME}AC | |||
BKUPWEB=${BKUPDIR}/${BKUPNAME}WEB | |||
BKUPDB=${BKUPDIR}/${BKUPNAME}DB | |||
BKUPIGNORE=/home/redbrick/wiki/tmp/bkup.ignore | |||
BKUPIGNOREAC=${BKUPIGNORE}.ac | |||
BKUPIGNOREWEB=${BKUPIGNORE}.web | |||
################################################## | |||
# Create ignore lists | |||
rm -rf $BKUPIGNOREAC | |||
# Do not recurse into public_html | |||
echo "./public_html" >> $BKUPIGNOREAC | |||
# Anything in tmp is unimportant | |||
echo "./tmp" >> $BKUPIGNOREAC | |||
# Do not need to backup email | |||
echo "./Maildir" >> $BKUPIGNOREAC | |||
rm -rf $BKUPIGNOREWEB | |||
# Anything in test is unimportant | |||
echo "./test" >> $BKUPIGNOREWEB | |||
################################################## | |||
# clean out backup directory first! | |||
rm -rf $BKUPDIR | |||
# make directory in /var/tmp to store tar | |||
mkdir $BKUPDIR | |||
chmod 700 $BKUPDIR | |||
################################################## | |||
# Make SQL backup | |||
#echo Backing up SQL Database | |||
mysqldump --add-drop-table -h mysql.internal --password=******** -u wiki --databases wiki > ${BKUPDB}.sql | |||
################################################## | |||
# Making tars | |||
echo Backing Up Local Account | |||
cd /home/redbrick/wiki | |||
tar cfX "${BKUPAC}.tar" $BKUPIGNOREAC . | |||
echo Backing Up Web Space | |||
cd /webtree/w/wiki | |||
tar cfX "${BKUPWEB}.tar" $BKUPIGNOREWEB . | |||
echo All Backups Complete! | |||
################################################## | |||
echo Zipping... | |||
gzip "${BKUPAC}.tar" | |||
gzip "${BKUPWEB}.tar" | |||
gzip "${BKUPDB}.sql" | |||
echo Zip Complete. | |||
################################################## | |||
==Upgrading MediaWiki== | ==Upgrading MediaWiki== | ||
One of the reasons for using MediaWiki is that it'll be easier for upgrading. MediaWiki is trival for upgrading as all the data is stored in an SQL database and the settings are stored in a file called 'LocalSettings.php'. So it should be a matter of overwriting the MediaWiki files, adding '#!/usr/local/bin/php' to 'index.php' and calling an SQL update script. I haven't performed an upgrade yet so when I do I'll update these instructions. | |||
==Extensions and other scripts in use== | ==Extensions and other scripts in use== | ||
===MyRSS=== | ===MyRSS=== |
Revision as of 10:13, 6 September 2005
I'm going to use this topic as a place to hold information about maintaining this wiki. Like Help:Contents it may split up into other smaller articles.
Creating Backups
If you login into Redbrick as the User Wiki you can execute a simple script I wrote called 'wiki_backup'. This dumps the SQL and tar.gz public_html and the wiki home directory and places it in /var/tmp for downloading using SFTP. The only reason the wiki home directory is tar.gz is that TWiki used to store some stuff there.
I've blanked the password out in the script example below.
#!/bin/sh BKUPDIR=/var/tmp/wiki BKUPNAME=`date +%Y-%m-%d`RedbrickWiki BKUP=${BKUPDIR}/${BKUPNAME} BKUPAC=${BKUPDIR}/${BKUPNAME}AC BKUPWEB=${BKUPDIR}/${BKUPNAME}WEB BKUPDB=${BKUPDIR}/${BKUPNAME}DB BKUPIGNORE=/home/redbrick/wiki/tmp/bkup.ignore BKUPIGNOREAC=${BKUPIGNORE}.ac BKUPIGNOREWEB=${BKUPIGNORE}.web ################################################## # Create ignore lists rm -rf $BKUPIGNOREAC # Do not recurse into public_html echo "./public_html" >> $BKUPIGNOREAC # Anything in tmp is unimportant echo "./tmp" >> $BKUPIGNOREAC # Do not need to backup email echo "./Maildir" >> $BKUPIGNOREAC rm -rf $BKUPIGNOREWEB # Anything in test is unimportant echo "./test" >> $BKUPIGNOREWEB ################################################## # clean out backup directory first! rm -rf $BKUPDIR # make directory in /var/tmp to store tar mkdir $BKUPDIR chmod 700 $BKUPDIR ################################################## # Make SQL backup #echo Backing up SQL Database mysqldump --add-drop-table -h mysql.internal --password=******** -u wiki --databases wiki > ${BKUPDB}.sql ################################################## # Making tars echo Backing Up Local Account cd /home/redbrick/wiki tar cfX "${BKUPAC}.tar" $BKUPIGNOREAC . echo Backing Up Web Space cd /webtree/w/wiki tar cfX "${BKUPWEB}.tar" $BKUPIGNOREWEB . echo All Backups Complete! ################################################## echo Zipping... gzip "${BKUPAC}.tar" gzip "${BKUPWEB}.tar" gzip "${BKUPDB}.sql" echo Zip Complete. ##################################################
Upgrading MediaWiki
One of the reasons for using MediaWiki is that it'll be easier for upgrading. MediaWiki is trival for upgrading as all the data is stored in an SQL database and the settings are stored in a file called 'LocalSettings.php'. So it should be a matter of overwriting the MediaWiki files, adding '#!/usr/local/bin/php' to 'index.php' and calling an SQL update script. I haven't performed an upgrade yet so when I do I'll update these instructions.