upgrade

This page describes how to backup and upgrade the contents of this wiki

Backup

  • download the whole wiki folder at ./httpdocs/wiki to your local machine
  • (you might need to enable and run ./httpdocs/fixfiles.php on your installation to make sure chmod is setup correctly
  • finally, run upgrade.sh backup to create a wiki-backup.tar.gz of all important files (plugins and templates will not be backed up)

Upgrade

  • make backup first and place wiki-backup.tar.gz into Sites folder

Upgrade Test Run

  • Upload new wiki folder to a different directory
  • adjust ./httpdocs/wiki/.htaccess

upgrade.sh code

#!/bin/sh
 
wikidir=./wiki
 
all() {
	clean && import && migrate
}
 
import() {
	echo "##### importing"
	tar xfz dokuwiki-*.tgz
	mv dokuwiki $wikidir
	cd $wikidir
	chmod 777 conf
	chmod 777 lib/tpl
	chmod 777 lib/plugins
	chmod -R 777 data
	cd ..
}
 
migrate() {
	echo "##### migrating"
	tar xfpz wiki-backup.tar.gz
	cp -pR backup/* $wikidir
	cp     backup/.htaccess $wikidir
}
 
backup() {
	echo "##### backup"
	[ -d backup ] && rm -rf backup
	mkdir backup
	mkdir backup/conf
	mkdir backup/data
	mkdir backup/data/pages
	mkdir backup/data/attic
	mkdir backup/data/meta
	mkdir backup/data/media
	mkdir backup/data/media_attic
	mkdir backup/data/media_meta
 
	# backup config
	cp $wikidir/.htaccess           backup
	cp $wikidir/conf/local.php      backup/conf
	cp $wikidir/conf/users.auth.php backup/conf
	cp $wikidir/conf/acl.auth.php   backup/conf
 
	# backup data dir
	cp -R $wikidir/data/pages/*       backup/data/pages
	cp -R $wikidir/data/attic/*       backup/data/attic
	cp -R $wikidir/data/meta/*        backup/data/meta
	cp -R $wikidir/data/media/*       backup/data/media
	cp -R $wikidir/data/media_attic/* backup/data/media_attic
	cp -R $wikidir/data/media_meta/*  backup/data/media_meta
 
	# remove OSX extended attributes
	xattr -c -r backup
 
	chmod -R 777 backup
	rm -rf wiki-backup.tar.gz
	tar cfpz wiki-backup.tar.gz backup
	rm -rf backup
}
 
clean() {
	echo "##### cleaning"
	rm -rf $wikidir
	rm -rf backup
	rm -rf dokuwiki
}
 
usage() {
	echo "Usage: $0 <action>"
	echo
	echo "ACTIONS:"
	declare -F | awk '{print "   "$3}' | grep -v usage && echo
}
 
if [ $# -eq 0 ]; then
	usage
	exit
fi
 
action="$1"
shift
 
declare -F "$action" >/dev/null && $action $*
[ $? -ne 0 ] && echo "no such action: $action"
 
echo "##### done"
  • upgrade.txt
  • Zuletzt geändert: 16.11.2016 23:18 (vor 8 Jahren)
  • von 127.0.0.1