Redbrick Wiki:Maintenance: Difference between revisions

From Redbrick Wiki
Jump to navigation Jump to search
mNo edit summary
(Posting by Email Idea. Good idea/bad idea?)
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.
==Future Work==
===Posting by Email===
Just an idea I saw on the Mediawiki-l list. The idea is you forward the email to wiki@redbrick.dcu.ie and then using something like procmail, parse the email and create a new topic for it.
[http://www.pronique.com/content/view/13/29/ This is a php script for adding topics from a specially formatted text file]. It would be trivial to write a script that grabs the email, puts it in a file and the peridocially run this script to add it. What do people think? (Direct respones to [[Redbrick Wiki Talk:Maintenance]].


==Creating Backups==
==Creating Backups==

Revision as of 08:57, 9 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.

Future Work

Posting by Email

Just an idea I saw on the Mediawiki-l list. The idea is you forward the email to wiki@redbrick.dcu.ie and then using something like procmail, parse the email and create a new topic for it.

This is a php script for adding topics from a specially formatted text file. It would be trivial to write a script that grabs the email, puts it in a file and the peridocially run this script to add it. What do people think? (Direct respones to Redbrick Wiki Talk:Maintenance.

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.

Extensions and other scripts in use

MyRSS

RSSFeed

GoogleSiteMaps

Moving from TWiki to MediaWiki