Lade...
 

UpgradeScript

TikiWiki 1.9 Update Script

Copy to clipboard
#!/bin/bash # # Tiki 1.9 update script (from 1.8 or 1.9.x to newer 1.9.x) # tiki cvs directory: SOURCE=/cvs/BRANCH-1-9 # user and group the webserver is running under: WEBUSER=webuser WEBGROUP=webgroup # dir where your robots.txt can be found: ROBOTPATH=/root # backup directory BACKUPPATH=/var/backup # --- installation path will be $ROOT/$TARGET/$SUBDIR: # the root dir where all the vhost docroots are: ROOT=/www/vhosts # the names of the vhost docroots: TARGETS="mydomain1.org mydomain2.com" # subdir with the actual content: SUBDIR=httpdocs # ------ do not cross this line! edit above ------ # loop through all existing tiki sites: for TARGET in ${TARGETS} do SERVER=${ROOT}/${TARGET}/${SUBDIR} echo "[${SERVER}/]" if [ -e ${SERVER}/ ]; then echo " ! OK: doing upgrade" cp -R ${SOURCE}/* ${SERVER} # --- we only want some of the plugins: mv -f ${SERVER}/lib/wiki-plugins/w* ${SERVER}/lib/wiki-plugins-dist/ PLUGINS="article articles box category catorphans catpath center code \ div dl fancytable gauge lang module mono rss sort split sub" for PLUGIN in ${PLUGINS} do echo "installing plugin wikiplugin_${PLUGIN}.php" cp ${SERVER}/lib/wiki-plugins-dist/wikiplugin_${PLUGIN}.php \ ${SERVER}/lib/wiki-plugins/ done # --- clean caches: rm -rf ${SERVER}/templates_c/* ${SERVER}/temp/cache/* \ ${SERVER}/modules/cache/*.cache # --- remove CVS stuff: `cd ${SERVER} ; find . -name "CVS" | xargs -n1 rm -rf` `cd ${SERVER} ; find . -name ".cvsignore" | xargs -n1 rm -rf` # --- set some permissions: chmod go-r ${SERVER}/tiki-install.php chown -R ${WEBUSER}:${WEBGROUP} ${SERVER}/* chmod a+x ${SERVER}/setup.sh `cd ${SERVER} ; su -c './setup.sh ${WEBUSER} ${WEBGROUP}'` chmod a-x ${SERVER}/setup.sh echo " * install new robots.txt" cp /${ROBOTPATH}/robots.txt ${SERVER} # --- update database: USER=`cat ${SERVER}/db/local.php | grep user | awk -F"'" '{ print $2; }'` PASS=`cat ${SERVER}/db/local.php | grep pass | awk -F"'" '{ print $2; }'` DB=`cat ${SERVER}/db/local.php | grep dbs | awk -F"'" '{ print $2; }'` # backup db in case something breaks mysqldump -u${USER} -p${PASS} ${DB} > ${BACKUPPATH}/${DB}.sql # now upgrade db, ignoring all errors (-f) mysql -u${USER} -p${PASS} -f ${DB} < ${SERVER}/db/tiki_1.8to1.9.sql else echo " ! ERROR: dir ${SERVER}/ not found" fi done

Zu dieser Seite haben beigesteuert: ohertel und admin .
Seite zuletzt geändert: am 27.03.06 22:09 von ohertel.