Environment

The following three directory paths are important:

Backup

First of all, you want to be sure you have a backup of all your data. To be sure we can easily restore and go back to the previous situation with a working MoinMoin 1.5, I suggest to not only backup <path-to-instance> but also <path-to-libs> and <path-to-share>.

# cd /opt
# mkdir backup-wiki
# cd backup-wiki
# tar cvzf _libs_MoinMoin1.5.tgz <path-to-libs>
# tar cvzf _share_MoinMoin1.5.tgz <path-to-share>
# tar cvzf _data_MoinMoin1.5.tgz <path-to-instance>

Purge

To be sure that no conflict or problem araise, we will erase all the MoinMoin 1.5 installed files.

# rm -fr <path-to-libs> <path-to-share>

{i} this step is probably not necesary, but I got some problems when I migrate, and there seems to be related to a bad copy, so purging solved them

MoinMoin 1.6 installation

Files

Now, we will install the files from the new version. After downloading and decompressing of the archive, go to its directory and run

# python setup.py install --record=../install-1.6.x.log

The file ../install-1.6.x.log will contain the list of files which where copied during the installation

Web server

Now, you must update your moin.cgi (or equivalent) of your instance

# cd <path-to-instance>
# cd cgi-bin
# cp <path-to-share>/server/moin.cgi .

And edit it to fit to your configuration. In general, you just have to change this line

sys.path.insert(0, '<path-to-instance>')

You also need to edit your Apache configuration to have something like this

Alias /moin_static16X/ <path-to-share>/htdocs/           
ScriptAlias /mywiki <path-to-instance>/cgi-bin/moin.cgi

Change /moin_static16X/ to fit the 1.6.X version of MoinMoin you use.

If you want you can also have your MoinMoin engine installed in the root of you domain, check HelpOnConfiguration/ApacheVoodoo

Updating system pages

Under <path-to-instance>/underlay directory are stored the default MoinMoin pages. Now that MoinMoin 1.6 files are installed, you must update this directory.

# cd <path-to-instance>
# cp -R <path-to-share>/underlay .

Updating your instance configuration

I'm not sure if the <path-to-instance>/wikiconfig.py needs or not to be updated. On my server, I preferred to install the new version and then update it to fit my configuration

# cp <path-to-share>/config/wikiconfig.py .

Migrate the data

The most crucial (and critical) part is the migration of your data. This is based on a set of scripts which convert your 1.5.X data to 1.6.X.

# su www-data
$ cd <path-to-instance>
$ moin --config-dir=<path-to-instance> --wiki-url=wiki.domain.tld migration data

You'll get an output similar to

Calling migration script for <path-to-instance>/data, base revision 1050700
Returned. New rev is 1050800.
Calling migration script for <path-to-instance>/data, base revision 1050800
Returned. New rev is 1059999.
Calling migration script for <path-to-instance>/data, base revision 1059999
You must first edit <path-to-instance>/data/rename1.txt.
For editing it, please use an editor that is able to edit UTF-8 encoded files.
Carefully edit - the fields are separated by a | char, do not change this!
Entries in this file look like:
PAGE OLDPAGENAME NEWPAGENAME
FILE OLDPAGENAME OLDFILENAME NEWFILENAME
You may ONLY edit the rightmost field (the new name - in case you want to rename
 the page or file).

After you have finished editing, rename the file to <path-to-instance>/data/rename2.txt and re-issue the moin migrate command.
Final mig script reached, migration is complete.

As MoinMoin 1.6 distinguish between spaces (" ") and underscores ("_") in page names, the migration lets you the possibility to rename some pages. To do it, just edit the file <path-to-instance>/data/rename1.txt to fix page or attachments names.BR When it's ok, just rename this file to rename2.txt and relaunch the previous command.

Finish the migration

Normally, the migration is now complete and you just have to do some things:

MoinMoin: EricVeirasGalisson/MigratingFromMoin15ToMoin16 (last edited 2009-04-26 11:01:39 by KevinLeadbeater)