summaryrefslogtreecommitdiff
path: root/TWiki/TWikiUpgradeGuide.mdwn
blob: 69624b8a3d74124936ac39405c1101b9629bcd83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
%TOC% %STARTINCLUDE%

# <a name="TWiki_Upgrade_Guide"> TWiki Upgrade Guide </a>

_Upgrade from TWiki 01-Dec-2000 to TWiki 01-Sep-2001 (previous to new full release)_

## <a name="Overview"> Overview </a>

The latest version of TWiki (01-Sep-2001) involves several major new features and numerous enhancements to the last full version (01-Dec-2000). The file system set-up is almost identical, but much of the underlying data structure and processes is new. With all the changes, the upgrade procedure is straightforward, and your existing page data is imported directly.

## <a name="Upgrade_Requirements"> Upgrade Requirements </a>

* To upgrade from a 01-Dec-2000 standard installation to the new, next generation 01-Sep-2001 TWiki Production Release, follow the instructions below.

* **_NOTE:_** To upgrade from a **pre-01-Dec-2000** TWiki, start with %TWIKIWEB%.TWikiUpgradeTo01Dec2000.

* To upgrade from a Beta of the new release, or if you made custom modifications to the application, read through all new reference documentation, then use the procedure below as a guideline.

## <a name="Major_Changes_from_TWiki_01_Dec_"> Major Changes from TWiki 01-Dec-2000 </a>

The 01-Sep-2001 release includes the following new features and enhancements:

* **[[TWIKIWEBTWikiPlugins]]** - Easily install program enhancements using external plug-in modules. Developers can create plug-ins in Perl, with the [[TWIKIWEBTWikiPlugins]].
  * %TWIKIWEB%.InterwikiPlugin (preinstalled) - Link to external sites with text aliases, `SiteAlias:Page`; rules are defined in [[InterWikis]]. (Get more Plugins from the TWiki:Plugins web.)
* **[[TWIKIWEBTWikiTemplates]]** - New, more flexible template system.
* **[[TWIKIWEBTWikiSkins]]** - Overwrite template headers and footers; page content is unaffected.
* **[[TWIKIWEBTWikiMetaData]]** - New data format
* **[[TWIKIWEBTWikiForms]]** - Create multiple input forms per web; data is rendered in HTML tables.
* **[[TWIKIWEBManagingTopics]]** - Individual topics can be renamed, moved and deleted through the browser. Deleted topics are stored in a common Trash web.
* **[[TWIKIWEBTWikiUserAuthentication]]** - Change and reset passwords using forms.
* **[[TWIKIWEBTWikiVariables]]** - <code>%TOC%</code> variable generates a hierarchical table of contents from topic headings: &lt;h1&gt;...&lt;h6&gt;.
* **[[TWIKIWEBTWikiVariables]]** - Text formatting rules to generate automatic links from any combination of words and spaces.
* **[[TWIKIWEBFileAttachment]]** - Changes made to files attached to topics are now saved under revision control (RCS).
* **[[TWIKIWEBTWikiAccessControl]]** - Lets you to make the members of one user group - by default, TWikiAdminGroup - into TWiki superusers, with the ability to overwrite locked topics from the browser interface. (This gets around the problem of topic lockouts, caused by typos in access privilege definitions.)
* **HierarchicalNavigation** uses new [[TWIKIWEBTWikiMetaData]] variables to link hierarchically.
* **Convert to XHTML** - Pages are rendered for display in XHTML 1.0, as far as possible without breaking HTML 3.2 compliance.

## <a name="TWiki_Directory_Structure_and_Fi"> TWiki Directory Structure and File Names </a>

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:

<table border="1" cellpadding="1" cellspacing="0">
  <tr>
    <th bgcolor="#99CCCC"><strong>From TWiki 01-Dec-2000:</strong></th>
    <th bgcolor="#99CCCC"><strong>To TWiki 01-Sep-2001:</strong></th>
  </tr>
  <tr>
    <td><code>twiki/bin/wikicfg.pm</code></td>
    <td><code>twiki/lib/TWiki.cfg</code></td>
  </tr>
  <tr>
    <td><code>twiki/bin/wiki.pm</code></td>
    <td><code>twiki/lib/TWiki.pm</code></td>
  </tr>
  <tr>
    <td><code>twiki/bin/wikiaccess.pm</code></td>
    <td><code>twiki/lib/TWiki/Access.pm</code></td>
  </tr>
  <tr>
    <td><code>twiki/bin/wikiprefs.pm</code></td>
    <td><code>twiki/lib/TWiki/Prefs.pm</code></td>
  </tr>
  <tr>
    <td><code>twiki/bin/wikisearch.pm</code></td>
    <td><code>twiki/lib/TWiki/Search.pm</code></td>
  </tr>
  <tr>
    <td><code>twiki/bin/wikistore.pm</code></td>
    <td><code>twiki/lib/TWiki/Store.pm</code></td>
  </tr>
</table>

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

## <a name="Standard_Upgrade_Procedure"> Standard Upgrade Procedure </a>

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.

<table border="1" cellpadding="1" cellspacing="0">
  <tr>
    <th bgcolor="#99CCCC" colspan="2"><strong>Before Switch:</strong></th>
    <th bgcolor="#99CCCC" colspan="2"><strong>After Switch:</strong></th>
  </tr>
  <tr>
    <th bgcolor="#99CCCC"><strong>Current 01-Dec-2000:</strong></th>
    <th bgcolor="#99CCCC"><strong>New 01-Sep-2001:</strong></th>
    <th bgcolor="#99CCCC"><strong>Obsolete 01-Dec-2000:</strong></th>
    <th bgcolor="#99CCCC"><strong>New 01-Sep-2001:</strong></th>
  </tr>
  <tr>
    <td><code>twiki/templates/</code></td>
    <td><code>twiki/templates2/</code></td>
    <td><code>twiki/templates1/</code></td>
    <td><code>twiki/templates/</code></td>
  </tr>
  <tr>
    <td><code>twiki/bin/</code></td>
    <td><code>twiki/bin/2/</code></td>
    <td> (overwritten) </td>
    <td><code>twiki/bin/</code></td>
  </tr>
  <tr>
    <td> (N/A) </td>
    <td><code>twiki/bin/lib/</code></td>
    <td> (N/A) </td>
    <td><code>twiki/lib/</code></td>
  </tr>
  <tr>
    <td><code>twiki/data/TWiki</code></td>
    <td><code>twiki/data/TWiki2</code></td>
    <td><code>twiki/data/TWiki1</code></td>
    <td><code>twiki/data/TWiki</code></td>
  </tr>
  <tr>
    <td colspan="4"> (other directories do not change) </td>
  </tr>
</table>

Alternatively you could move the existing installation away, install the 01-Sep-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-Sep-2001 release, importing your original page data and related files:

### <a name="Pre_Upgrade_Preparation"> Pre-Upgrade Preparation </a>

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/`

### <a name="Step_1_Backup_amp_Unpack"> Step 1: Backup &amp; Unpack </a>

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: <br />`mkdir -p ~/tmp/`<br />`cp -p ~/downloads/TWiki20010901.zip ~/tmp/`<br />`cd ~/tmp/`<br />`unzip ~/tmp/TWiki20010901.zip`

### <a name="Step_2_Upgrade_TWiki_document_fi"> Step 2: Upgrade TWiki document files </a>

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

### <a name="Step_3_Install_new_template_file"> Step 3: Install new template files </a>

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

### <a name="Step_4_Install_new_data_and_pub_"> Step 4: Install new data and pub files </a>

1. Move the TWiki web to a temporary TWiki2 `twiki/data/TWiki2` directory. Do the same to files attached to this web, ex: <br />`mv ~/tmp/data/TWiki $TWIKIROOT/data/TWiki2`<br />`mv ~/tmp/pub/TWiki $TWIKIROOT/pub/TWiki2`
2. Move &amp; rename the Know web to a temporary `twiki/data/Know2` directory, ex: <br />`mv ~/tmp/data/Know $TWIKIROOT/data/Know2`<br />`mv ~/tmp/pub/Know $TWIKIROOT/pub/Know2`
3. Move the \_default and Trash web, ex: <br />`mv ~/tmp/data/_default $TWIKIROOT/data`<br />`mv ~/tmp/data/Trash $TWIKIROOT/data`
4. Move the MIME types file, ex: <br />`mv ~/tmp/data/mime.types $TWIKIROOT/data`
5. Move the TWiki logo files, ex: <br />`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 the user of your cgi-scripts, i.e. `www-data`. A simple way to switch the locker of the RCS files is to use sed: <br />`for f in *,v; do sed 's/nobody\:/www-data\:/' $f > x; mv x $f; done`

### <a name="Step_5_Install_new_CGI_scripts"> </a> Step 5: Install new CGI scripts

1. Move &amp; rename the CGI script directory to a temporary `twiki/bin/2` directory, ex: <br />`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: <br />`cp -p $TWIKIROOT/bin/somescript $TWIKIROOT/bin/2`
4. In case you use basic authentication, rename `.htaccess.txt` to `.htaccess` and customize it, ex: <br />`cd $TWIKIROOT/bin/2`<br />`mv .htaccess.txt .htaccess`<br />`diff ../.htaccess .`<br /> and merge the content
5. Pay attention to the file and directory permissions (security issue). Set permissions, ex: <br />`chmod 755 *.cgi`

### <a name="Step_6_Install_new_Perl_library_"> Step 6: Install new Perl library files </a>

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

### <a name="Step_7_Set_configurations_and_te"> Step 7: Set configurations and test installation </a>

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: <br />`cd $TWIKIROOT/bin/lib`<br />`diff ../wikicfg.pm TWiki.cfg`
2. Make sure to set the correct temporary location of templates and scripts, ex: <br />`$scriptUrlPath    = "/twiki/bin/2";`<br />`$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:
  * Old URL: `http://localhost/cgi-bin/view`
  * New URL: `http://localhost/cgi-bin/2/view`

### <a name="Step_8_Update_topics"> Step 8: Update topics </a>

You can do the following changes using your old TWiki 01-Dec-2000 or new TWiki 01-Sep-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:
  * The original `TWiki` web.
  * The new `TWiki2` web, which gets renamed to `TWiki` when you switch over the installation.
2. In case you customized `TWiki.TWikiRegistration`, merge your changes back into `TWiki2.TWikiRegistration`.
3. Copy `TWiki.TWikiWebsTable` to `TWiki2.TWikiWebsTable`.
  * Do the same for any other topics you might have created in the `TWiki` web.
4. In `TWiki2.TWikiPreferences`, merge the old `TWiki.TWikiPreferences` settings and customize it.
  * Add your webs to WIKIWEBLIST
  * Set the WIKIWEBMASTER
  * Set the SMTPMAILHOST
5. In `WebPreferences` of all webs, add or change the following web preferences: (see `TWiki.WebPreferences`)
  * Add a NOSEARCHALL in case you want to exclude the web from a `web="all"` search: <br />`* Set NOSEARCHALL = on`
  * In WEBTOPICLIST, remove the <code>%WEB% . \{\}</code> decoration from the list (it is now in the templates), ex: <br />`* Set WEBTOPICLIST = <a href="%HOMETOPIC%">Home</a>`<br />`  | <a href="WebChanges">Changes</a>`<br />`  | <a href="WebIndex">Index</a>`<br />`  | <a href="WebSearch">Search</a>`<br />`  | Go <input type="text" name="topic" size="16" />`
  * Add a these new preferences: <br />`* Set DENYWEBVIEW =`<br />`* Set ALLOWWEBVIEW =`<br />`* Set DENYWEBRENAME =`<br />`* Set ALLOWWEBRENAME =`
  * Set the FINALPREFERENCES: <br />`* Set FINALPREFERENCES = WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME`
6. Optional: In `WebSearch` of all webs, replace content with this one line: <br /><code>%INCLUDE\{"%TWIKIWEB%.WebSearch"\}%</code>
7. Optional: In `WebChanges` of all webs, replace content with this one line: <br /><code>%INCLUDE\{"%TWIKIWEB%.WebChanges"\}%</code>

### <a name="Step_9_Customize_template_files"> Step 9: Customize template files </a>

**_NOTE:_** Skip this step if you did not customize your template files.

1. Remember that you have now two template directories:
  * The original `twiki/templates`.
  * The new `twiki/templates2`, which gets renamed to `twiki/templates` when you switch over the installation.
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:
  * Templates are now rendered by TWiki. You can use all [[TextFormattingRules]], but you have to escape unwanted ones. Also, remove empty lines unless you want a `=<p />` tag added.
  * Added [[TWikiMetaData]] rendering.
3. Form Templates replace the TWikiCategoryTables:
  * Create a replacement `WebForm` topic based on `twikicatitems.tmpl` in each web that uses a Category Table. See details in [[TWikiForms]] and compare with the settings in the <code>Know2.WebPreferences</code> topic. <br />**_NOTE:_** Do not remove the `twikicatitems.tmpl` file, it is still used for topics that are of the old format.
  * Searches need to be adjusted to deal with format change. It is possible to define a regular expression search that can deal at the same time with topics in the old format and new format.
    * **_Example:_** List all topics in the Know web that have a [[Know/TopicClassification]] of [[Know/PublicFAQ]]: <br /><tt>%SEARCH\{ "[T]opicClassification.\*?(td..td|value\\=).\*?[P]ublicFAQ" casesensitive="on" regex="on" nosearch="on" web="Know"\}%</tt><br /> (The `[T]` and `[P]` is done so that search does not find the topic where this search string is located in!)
    * **_Example:_** Create a link that lists all topics in the Know web with a [[Know/TopicClassification]] of [[Know/PublicFAQ]]: <br /><tt>[[%SCRIPTURL%/search%SCRIPTSUFFIX%/Know/?scope=text<br />&amp;search=%5BT%5DopicClassification.\*%3F%28td..td%7C<br />value%5C%3D%29.\*%3F%5BP%5DublicFAQ&amp;regex=on]\[All Public FAQ]]</tt><br />[[SCRIPTURLsearchSCRIPTSUFFIXKnowscopetextsearch5BT5DopicClassification3F28tdtd7Cvalue5C3D293F5BP5DublicFAQregexon]]
4. For each web that has a custom <code>**notedited.tmpl**</code> template, create an equivalent [[WebTopicEditTemplate]] to conform with the new [[TWIKIWEBTWikiTemplates]]. The new format replaces the `notedited.tmpl`, `notext.tmpl` and `notwiki.tmpl` templates.

### <a name="Step_10_Switch_over_to_new_insta"> Step 10: Switch over to new installation </a>

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

1. Test your new 01-Sep-2001 installation under `twiki/bin/2/view` to make sure everything works as expected.
  * **_NOTE:_** Don't worry about the Plugins, they'll work after the switch.
2. Edit `$TWIKIROOT/bin/2/TWiki.cfg` and remove the `/2` from `$scriptUrlPath` and `$templateDir`, ex: <br />`$scriptUrlPath    = "/twiki/bin";`<br />`$templateDir      = "/home/httpd/twiki/templates";`
3. Rename the `TWiki2` web to `TWiki`, including attachments, ex: <br />`cd $TWIKIROOT/data`<br />`mv TWiki TWiki1`<br />`mv TWiki2 TWiki`<br />`cd $TWIKIROOT/pub`<br />`mv TWiki TWiki1`<br />`mv TWiki2 TWiki`
4. Rename the `templates2` directory to `templates`, ex: <br />`cd $TWIKIROOT`<br />`mv templates templates1`<br />`mv templates2 templates`
5. Move the `lib` directory one level up from `$TWIKIROOT/bin/lib` to `$TWIKIROOT/lib`, ex: <br />`cd $TWIKIROOT`<br />`mv bin/lib .`
6. Copy content of `bin/2` to `bin`, ex: <br />`cd $TWIKIROOT/bin`<br />`cp -p bin/2/* .`<br />`cp -p bin/2/.htaccess .`
7. Point your browser to the original URL and make sure the relocated 01-Sep-2001 installation works as expected: check browsing, searching and user registration.
8. Clean up and remove obsolete directories:
  * Remove directory `$TWIKIROOT/bin/2`
  * Remove directory `$TWIKIROOT/templates1`
  * Remove directory `$TWIKIROOT/data/TWiki1`
  * Remove directory `$TWIKIROOT/pub/TWiki1`
  * Remove temporary directory, ex: `~/tmp`

### <a name="Step_11_Test_the_TWiki_Plugins"> Step 11: Test the TWiki Plugins </a>

1. Test the new [[TWikiPlugins]] by checking the Plugins settings in [[TWikiPreferences]].
  * The <code>EmptyPlugin</code>, <code>DefaultPlugin</code>, and <code>InterwikiPlugin</code> should be preinstalled. To check the %TWIKIWEB%.InterwikiPlugin, go to its page.
2. If you have customized the functions `extendHandleCommonTags`, `extendGetRenderedVersionOutsidePRE` and `extendGetRenderedVersionInsidePRE` in `twiki/bin/wikicfg.pm`:
  * Merge those changes back into `twiki/lib/TWiki/Plugins/Default.pm`

### <a name="General_Format_Changes"> General Format Changes </a>

* The format of the <code>%GMTIME\{"..."\}%</code> and <code>%SERVERTIME\{"..."\}%</code> variables is now <code>**"$hour:$min"**</code> instead of `"hour:min"`. More in %TWIKIWEB%.TWikiVariables.

* [[TWikiVariables]]: Enhanced table syntax might have unwanted side effect: <code>| \*bold\* |</code> cells, `|  center aligned  |` and `|   right aligned |` cells, span multiple columns using `| empty cells |||`. More in [[TextFormattingRules]].

* Use <code>**Net::SMTP**</code> module instead of `sendmail` if installed.

* Use <code>**&lt;verbatim&gt; ... &lt;/verbatim&gt;**</code> tags instead of `<pre> ... </pre>` tags where appropriate. More in %TWIKIWEB%.TextFormattingRules.

* New variable <code>**%STARTINCLUDE%**</code> and <code>**%STOPINCLUDE%**</code> variables to control what gets included of a topic. More in %TWIKIWEB%.TWikiVariables.

* [[FileAttachment]] info is now stored as [[TWikiMetaData]].
  * Upgrading of imported pagess is done automatically after first edit, on save. "In memory" upgrade is done on topic view.
  * Attachments are now under revision control: `$attachAsciiPath` in `TWiki.cfg` defines which file types are stored in ASCII, otherwise, binary format is used. This means that the RCS version used should support binary files.

* Handling for topic-specific templates like `edit.new.tmpl` has been removed and replaced by template topics in the new [[TWikiTemplates]].

* A new file `warning.txt` file can appear in the `data` directory. It may contain diagnostic info identifying problems that need fixing. This file could get fairly large if you have a lot of problems your site - you can delete it at any time.

## <a name="Known_Issues"> Known Issues </a>

* Check TWiki:Codev/KnownIssuesOfTWiki01Sep2001 for known issues of TWiki 01 Sep 2001 (production release)

-- [[JohnTalintyre]] - 18 Jul 2001 <br /> -- [[MikeMannix]] - 12 Sep 2001 <br /> -- [[PeterThoeny]] - 02 Oct 2001 <br />