My method to upgrade from Sep 2001 to Dec 2001 releases
I manage 3 wiki webs with different levels of customization. upgrading
releases is becoming a bit tricky... Here is the procedure I use, this
may be useful for others, and hints to what should be changed in TWiki
distrib structure as well for easier upgrade...
It works for my case: standard dir hierarchy, unix utils available.
I cut-n-paste the shell parts into a bash shell window, belonging to
the user ID of the apache web server or root.
First, define the 3 variables below for you installation, and check you have
the following programs installed:
The following part is different for each of my sites:
set -a
CUR=/www/wiki # where your current wiki install is running
OLD=/tmp/TWiki20010901 # where you uncompresseded the plain Sep rel
NEW=/tmp/TWiki20011201 # where you uncompresseded the plain Dec rel
TMP=/www/wiki2 # working copy of new wiki
be cautious and do a backup (once is sufficient):
# backup wiki in case something goes wrong, dont overwrite sane backup
# restore by: cd /;rm -rf $CUR;tar xfzpsPS /tmp/wiki-backup-for-dec01-upg.tgz
if test ! -e /tmp/wiki-backup-for-dec01-upg.tgz;then
cd $CUR; tar cfzpsPS /tmp/wiki-backup-for-dec01-upg.tgz .
fi
then, here is my procedure: I just cut-n-paste this:
(this part can be re-issued as long as something fails)
# make working copy, excluding the contents
rm -rf $TMP
rsync -au --hard-links --whole-file --devices --delete \
--sparse --one-file-system --force --include='data/TWiki**' \
--exclude='pub/[A-Z]**' --exclude='data/[A-Z]**' --exclude '*,v' \
$CUR/. $TMP
cd $NEW
>/tmp/null
# remove distrib parts that should not be used
rm -rf data/Main data/Test data/Trash pub/Test pub/Trash
rm -rf data/debug.txt data/warning.txt data/.htpasswd pub/favicon.ico pub/wikiHome.gif
rm -rf data/[A-Z]*/WebNotify.txt* data/[A-Z]*/WebPreferences.txt* data/[A-Z]*/WebStatistics.txt* data/*/.changes
rm -rf $TMP/MERGE_BIN $TMP/MERGE_CONFLICTS $TMP/MERGE_ERRORS
for i in `find . -type d`;do if test ! -d $TMP/$i;then mkdir $TMP/$i;fi;done
for i in `find . -type f`;do
i="${i#./}"
case "$i" in
*,v) ;;
*.[dD][lL][lL]|*.[gG][iI][fF])
if cmp -s $OLD/$i $NEW/$i; then :; else
if test ! -e $TMP/$i; then cp -a $i $TMP/$i
elif cmp $TMP/$i $NEW/$i; then :
else
echo "$i" >> $TMP/MERGE_BIN
fi
fi ;;
*) if test ! -e $TMP/$i; then cp -a $i $TMP/$i
else
if test -e $OLD/$i; then OLDF=$OLD/$i; else OLDF=/tmp/null;fi
cr-remove $TMP/$i $OLDF $NEW/$i
merge -q $TMP/$i $OLDF $NEW/$i
case $? in
1) echo $i >> $TMP/MERGE_CONFLICTS;;
2) echo $i >> $TMP/MERGE_ERRORS;;
esac
fi;;
esac
done
echo "============ echo Solving `wc -l $TMP/MERGE_CONFLICTS` conflicts by hand:"
for i in `cat $TMP/MERGE_CONFLICTS`; do
echo $i
tkdiff -o $TMP/$i -conflict $TMP/$i
done
if test -s $TMP/MERGE_ERRORS; then
echo '============ MERGE ERRORS:'; cat $TMP/MERGE_ERRORS
fi
if test -s $TMP/MERGE_BIN; then
echo '============ MERGE BIN FILES:'; cat $TMP/MERGE_BIN
fi
Version-specific upgrades
# From Sep 2001 to Dec 2001
cd $TMP
for i in data/*/WebIndex.txt;do if test ! -e ${i%/*}/WebTopicList.txt;then cp data/_default/WebTopicList.txt ${i%/*};fi;done
Then, if all went well above, you can test in place the new version in
$NEW, and then copy back the updated version:
cd $TMP;tar cfpsPS - .| ( cd $CUR; tar xfpsPS -)
So here it is. It may help some other people out there...
--
ColasNahaboo - 14 Dec 2001
Notes
- If you do this as another user as the UID of the web server, check file permissions afterwards
- check the first line of the bin/ script, to see if the perl path is the good one
--
ColasNahaboo - 14 Dec 2001
There is an
UpgradeTwiki script available for the latest
TWikiRelease01Sep2004.
--
PeterThoeny - 16 Sep 2004