TWiki Upgrade Guide

Upgrade from TWiki 01-Dec-2000 or TWiki 01-Sep-2001 to TWiki 01-Dec-2001 (previous to new full release)

This guide describes how to upgrade either from TWiki 01-Dec-2000 or TWiki 01-Sep-2001 to TWiki 01-Dec-2001.

Upgrade Requirements

Major Changes from TWiki 01-Sep-2001

The latest 01-Dec-2001 release includes the following new features and enhancements compared to the 01-Sep-2001 release:

Major Changes from TWiki 01-Dec-2000

The 01-Sep-2001 release includes the following new features and enhancements compared to the 01-Dec-2000 release:

TWiki Directory Structure and File Names

The TWiki directory structure remains the same, with one exception, the TWiki configuration file and Perl modules have been moved from the twiki/bin directory into it's own twiki/lib directory tree. The following files have been renamed and moved:

From TWiki 01-Dec-2000: To TWiki 01-Dec-2001:
twiki/bin/wikicfg.pm twiki/lib/TWiki.cfg
twiki/bin/wiki.pm twiki/lib/TWiki.pm
twiki/bin/wikiaccess.pm twiki/lib/TWiki/Access.pm
twiki/bin/wikiprefs.pm twiki/lib/TWiki/Prefs.pm
twiki/bin/wikisearch.pm twiki/lib/TWiki/Search.pm
twiki/bin/wikistore.pm twiki/lib/TWiki/Store.pm

A new twiki/lib/TWiki/Plugins directory contains the new Plugin modules.

Standard Upgrade Procedure from 01-Sep-2001 to 01-Dec-2001 Release

This incremental update can be performed easily.

The following steps describe the upgrade assuming that $TWIKIROOT is the root of your current 01-Sep-2001 release.

  1. Back up and prepare:
  2. Update files in TWiki root:
  3. Update template files:
  4. Update script files:
  5. Update library files:
  6. Update data/TWiki files: (in case you want the updated docs)
  7. Update pub/TWiki files:

Standard Upgrade Procedure from 01-Dec-2000 to 01-Dec-2001 Release

The idea is to have the new and old installation work in parallel so that you can test the new installation before switching over. That way you can make the switch on your live TWiki installation within one minute without affecting the users.

Before Switch: After Switch:
Current 01-Dec-2000: New 01-Dec-2001: Obsolete 01-Dec-2000: New 01-Dec-2001:
twiki/templates/ twiki/templates2/ twiki/templates1/ twiki/templates/
twiki/bin/ twiki/bin/2/ (overwritten) twiki/bin/
(N/A) twiki/bin/lib/ (N/A) twiki/lib/
twiki/data/TWiki twiki/data/TWiki2 twiki/data/TWiki1 twiki/data/TWiki
(other directories do not change)

Alternatively you could move the existing installation away, install the 01-Dec-2001 release into it's place and move your webs and pub files back.

Follow this step-by-step guide to upgrade from the 01-Dec-2000 TWiki to the 01-Dec-2001 release, importing your original page data and related files:

Pre-Upgrade Preparation

Two major areas of TWiki functionality - TWikiTemplates and TWikiForms (input forms associated with a topic)- are entirely different in the new TWiki. If you've customized your templates or use Category Tables, read those sections before starting your upgrade.

The following steps describe the upgrade on Unix. Windows setup is very similar. It's assumed that $TWIKIROOT is the root of your current 01-Dec-2000 release, ex: export TWIKIROOT=/some/dir/

Step 1: Backup & Unpack

  1. Back up all existing TWiki directories twiki/bin, twiki/pub, twiki/data, twiki/templates.
  2. Create a temporary directory and unpack the ZIP file there:
    mkdir -p ~/tmp/
    cp -p ~/downloads/TWiki20011201.zip ~/tmp/
    cd ~/tmp/
    unzip ~/tmp/TWiki20011201.zip

Step 2: Upgrade TWiki document files

  1. Move the document files to your TWiki root ( twiki ):
    mv ~/tmp/TWiki*.html $TWIKIROOT
    mv ~/tmp/index.html $TWIKIROOT
    mv ~/tmp/readme.txt $TWIKIROOT
    mv ~/tmp/license.txt $TWIKIROOT

Step 3: Install new template files

  1. Move & rename the template directory to a temporary twiki/templates2 directory, ex:
    mv ~/tmp/templates $TWIKIROOT/templates2
  2. Pay attention to the file and directory permissions (security issue). Set file permissions, ex:
    chmod 644 *.cgi

Step 4: Install new data and pub files

  1. Move the TWiki web to a temporary TWiki2 twiki/data/TWiki2 directory. Do the same to files attached to this web, ex:
    mv ~/tmp/data/TWiki $TWIKIROOT/data/TWiki2
    mv ~/tmp/pub/TWiki $TWIKIROOT/pub/TWiki2
  2. Move & rename the Know web to a temporary twiki/data/Know2 directory, ex:
    mv ~/tmp/data/Know $TWIKIROOT/data/Know2
    mv ~/tmp/pub/Know $TWIKIROOT/pub/Know2
  3. Move the _default and Trash web, ex:
    mv ~/tmp/data/_default $TWIKIROOT/data
    mv ~/tmp/data/Trash $TWIKIROOT/data
  4. Move the MIME types file, ex:
    mv ~/tmp/data/mime.types $TWIKIROOT/data
  5. Move the TWiki logo files, ex:
    mv ~/tmp/pub/*.gif $TWIKIROOT/pub
  6. Pay attention to the file permissions of the TWiki2 and Know2 directories and its files. The files must be writable by the cgi-scripts (usually user nobody).
  7. In case the cgi-scripts are not running as user nobody: The *,v RCS repository files delivered with the installation package are locked by user nobody and need to be changed to the user of your cgi-scripts, e.g., www-data. A simple way to switch the locker of the RCS files is to use sed:
    for f in *,v; do sed 's/nobody\:/www-data\:/' $f > x; mv x $f; done

Step 5: Install new CGI scripts

  1. Move & rename the CGI script directory to a temporary twiki/bin/2 directory, ex:
    mv ~/tmp/bin $TWIKIROOT/bin/2
  2. If necessary, change the script names to include the required extension, ex: .cgi
  3. Copy any additional scripts you might have from the 01-Dec-2000 release, ex:
    cp -p $TWIKIROOT/bin/somescript $TWIKIROOT/bin/2
  4. In case you use basic authentication, rename .htaccess.txt to .htaccess and customize it, ex:
    cd $TWIKIROOT/bin/2
    mv .htaccess.txt .htaccess
    diff ../.htaccess .
    and merge the content
  5. Pay attention to the file and directory permissions (security issue). Set permissions, ex:
    chmod 755 *.cgi

Step 6: Install new Perl library files

  1. Move the lib directory to a temporary twiki/bin/lib directory, ex:
    mv ~/tmp/lib $TWIKIROOT/bin
  2. Pay attention to the file and directory permissions (security issue). Set permissions, ex:
    chmod 644 *.pm

Step 7: Set configurations and test installation

  1. Merge the content of the old twiki/bin/wikicfg.pm into the new twiki/lib/TWiki.cfg configuration file. Use the diff command to find out the differences, ex:
    cd $TWIKIROOT/bin/lib
    diff ../wikicfg.pm TWiki.cfg
  2. Make sure to set the correct temporary location of templates and scripts, ex:
    $scriptUrlPath    = "/twiki/bin/2";
    $templateDir      = "/home/httpd/twiki/templates2";
  3. Do not merge the functions extendHandleCommonTags, extendGetRenderedVersionOutsidePRE, extendGetRenderedVersionInsidePRE from the old twiki/bin/wikicfg.pm. This is now handled by the Default plugin twiki/lib/TWiki/Plugins/Default.pm
  4. Test your new TWiki installation to see if you can view topics. Point your browser to the old installation and fix the URL to see the new installation, ex:

Step 8: Update topics

You can do the following changes using your old TWiki 01-Dec-2000 or new TWiki 01-Dec-2001 installation. Pointing your browser to the old installation for edit-copy-edit-paste operations is recommended, so that users don't get surprised by meta data content showing up in topics.

  1. Remember that you now have two TWiki webs:
  2. In case you customized TWiki.TWikiRegistration, merge your changes back into TWiki2.TWikiRegistration.
  3. Copy to TWiki2 any topics that you created in the TWiki web.
  4. In TWiki2.TWikiPreferences, merge the old TWiki.TWikiPreferences settings and customize it.
  5. In WebPreferences of all webs, add or change the following web preferences: (see TWiki.WebPreferences)
  6. Optional: In WebSearch of all webs, replace content with this one line:
    %INCLUDE{"%TWIKIWEB%.WebSearch"}%
  7. Optional: In WebChanges of all webs, replace content with this one line:
    %INCLUDE{"%TWIKIWEB%.WebChanges"}%

Step 9: Customize template files

NOTE: Skip this step if you did not customize your template files.

  1. Remember that you have now two template directories:
  2. Customized templates and skins need to be upgraded to the new TWikiTemplates. This isn't difficult, but you have be familiar with the new template set-up before starting the conversion. The safest way is to use the new templates as a base and to merge your changes back. Changes in new templates:
  3. Form Templates replace the TWikiCategoryTables:
  4. For each web that has a custom notedited.tmpl template, create an equivalent WebTopicEditTemplate to conform with the new TemplateTopics. The new format replaces the notedited.tmpl, notext.tmpl and notwiki.tmpl templates.

Step 10: Switch over to new installation

In this step, you move the working 01-Dec-2001 installation to the old 01-Dec-2000 installation, so that users don't have to change the URL.

  1. Test your new 01-Dec-2001 installation under twiki/bin/2/view to make sure everything works as expected.
  2. Edit $TWIKIROOT/bin/lib/TWiki.cfg and remove the /2 from $scriptUrlPath and $templateDir, ex:
    $scriptUrlPath    = "/twiki/bin";
    $templateDir      = "/home/httpd/twiki/templates";
  3. Rename the TWiki2 web to TWiki, including attachments, ex:
    cd $TWIKIROOT/data
    mv TWiki TWiki1
    mv TWiki2 TWiki
    cd $TWIKIROOT/pub
    mv TWiki TWiki1
    mv TWiki2 TWiki
  4. Rename the templates2 directory to templates, ex:
    cd $TWIKIROOT
    mv templates templates1
    mv templates2 templates
  5. Move the lib directory one level up from $TWIKIROOT/bin/lib to $TWIKIROOT/lib, ex:
    cd $TWIKIROOT
    mv bin/lib .
  6. Copy content of bin/2 to bin, ex:
    cd $TWIKIROOT/bin
    cp -p bin/2/* .
    cp -p bin/2/.htaccess .
  7. Point your browser to the original URL and make sure the relocated 01-Dec-2001 installation works as expected: check browsing, searching and user registration.
  8. Clean up and remove obsolete directories:

Step 11: Test the TWiki Plugins

  1. Test the new TWikiPlugins by checking the Plugins settings in TWikiPreferences.
  2. If you have customized the functions extendHandleCommonTags, extendGetRenderedVersionOutsidePRE and extendGetRenderedVersionInsidePRE in twiki/bin/wikicfg.pm:

General Format Changes

Known Issues

-- JohnTalintyre? - 18 Jul 2001
-- PeterThoeny - 03 Dec 2001
-- MikeMannix? - 05 May 2002