5752
Comment: $HTDOCS setting is "/moin", not "moin" for default wiki config
|
5795
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
[[TableOfContents]] | <<TableOfContents>> |
Line 19: | Line 19: |
For the curious, the {{{moinmoin-install}}} script may be viewed [http://git.hcoop.net/?p=hcoop/misc.git;a=blob_plain;f=bin/moinmoin-install;hb=HEAD here]. | For the curious, the {{{moinmoin-install}}} script may be viewed [[http://git.hcoop.net/?p=hcoop/misc.git;a=blob_plain;f=bin/moinmoin-install;hb=HEAD|here]] '''(FIXME: broken link)'''. |
Line 25: | Line 25: |
{{{moinMoin "mymoin" where | {{{ moinMoin "mymoin" where |
Line 27: | Line 28: |
end}}} | end }}} |
Line 33: | Line 35: |
{{{web "other" where | {{{ web "other" where |
Line 41: | Line 44: |
end}}} | end }}} |
Line 70: | Line 74: |
[[http://migre.me/3CVSa|acompanhantes curitiba]] |
|
Line 122: | Line 128: |
$ /usr/share/doc/moinmoin-common/examples/moin --config-dir=$CONFIGDIR --wiki-url=$WIKIURL migration data | $ cd $CONFIGDIR $ moin --wiki-url=$WIKIURL migration data |
Line 127: | Line 134: |
If you want to remove the "MoinEditorBackup" files from your wiki instance, then do the following. | If you want to remove the "!MoinEditorBackup" files from your wiki instance, then do the following. |
This page explains how to quickly set up a MoinMoin wiki on one of your domains, and also how to migrate old MoinMoin wiki instances to work with the current MoinMoin release.
Contents
New wiki
We already have MoinMoin installed on our system. All you need to do is run a script, add some DomTool configuration, and edit your wikiconfig.py file.
Making a new MoinMoin instance
All you have to do is figure out which directory you want to use to store the wiki (we refer to it as $INSTANCE below), and then run:
moinmoin-install $INSTANCE
For the curious, the moinmoin-install script may be viewed here (FIXME: broken link).
Adding to your Domtool configuration
The easiest thing is to set up a dedicated web site for serving a MoinMoin wiki, like so:
moinMoin "mymoin" where Script = home "$INSTANCE/moin.cgi" end
When this is done within $YOURDOMAIN, you get a new web virtual host mymoin.$YOURDOMAIN which expects your moin.cgi script to be in the base of your home directory. Change the Script parameter to alter this expectation. The static moin files are served out of http://mymoin.$YOURDOMAIN/moin/..., and the wiki pages themselves are accessed at URLs like http://mymoin.$YOURDOMAIN/PageName. If you do this, your $HTDOCS setting will be "/moin".
You can also add a MoinMoin wiki within a larger virtual host. For example:
web "other" where alias "/something" "/something_else"; addMoinMoin where Htdocs = "/wikidata"; Script = home "$INSTANCE/moin.cgi"; Prefix = "/mywiki" end end
Here, we add a wiki to a vhost other.$YOURDOMAIN that also has some other config. We ask to serve the static files with the URL prefix wikidata instead of moin, we say that moin.cgi file is found in the other subdirectory of our home directory, and we ask to serve wiki pages at http://other.$YOURDOMAIN/mywiki/PageName.
Modifying wikiconfig.py
As the final step, you will want to edit wikiconfig.py, which resides in your $INSTANCE folder. Remember the directory that you called $HTDOCS from the previous section, and use it below.
Change the line:
url_prefix = '/wiki'
to:
url_prefix = '$HTDOCS'
At this point, check out the rest of that file to set, for example, your site name. When done, tell domtool to update your configuration, and point a browser at your new wiki installation.
Migrating old MoinMoin wikis
Depending on the last version of MoinMoin you used, this could be tricky. The good news is that once you migrate your wiki instance to the version of MoinMoin that we have installed, migration should be a lot easier in the future.
If you know what version of MoinMoin you used previously, then skip to the appropriate section. Otherwise read on, and we will try to help you figure it out.
We will call your MoinMoin data directory $DATA.
Before MoinMoin 1.2
Good luck. You'll have to download MoinMoin 1.2.4 yourself, upgrade to it first, and then remove MoinMoin 1.2.4 and proceed with the next sections. If you have hosted a MoinMoin on an old HCoop server, you almost certainly had a later version of MoinMoin than this.
MoinMoin 1.2 through 1.3.4
If you want to know whether you have at least MoinMoin 1.3.4, check for the existence of the $DATA/plugin/__init__.py file. If you have it, skip this section. Otherwise, continue on.
First, back up your data by making a copy of it.
Then, change to the directory where the migration scripts are located:
$ cd /usr/share/python-support/python-moinmoin/MoinMoin/script/old/migration/
Then, consult /usr/share/doc/moinmoin-common/README.Migration.gz, and figure out which scripts you need to run. Unfortunately, you'll have to either know exactly which version of MoinMoin you were last using, or do some detective work by looking at the migration scripts themselves.
To run an individual script (in this example, the 12_to_13_mig11.py script), do:
$ ./12_to_13_mig11.py $DATA
This brings you up to MoinMoin 1.3.5.
MoinMoin 1.3.5
If you have previously used an old HCoop server, this is most likely the version you last used.
First, change to the directory where the migration scripts are located:
$ cd /usr/share/python-support/python-moinmoin/MoinMoin/script/old/migration/
Then, run just this one migration script:
$ ./152_to_1050300.py $DATA
This brings you up to MoinMoin 1.5.3.
MoinMoin 1.5.3 or later
You have it easy. Just run the following, from any directory.
$CONFIGDIR is the full path to the directory that has your wikidata.py file, without any "~" characters. We will call your Wiki URL (example: wiki.DOMAIN.TLD/) $WIKIURL.
$ cd $CONFIGDIR $ moin --wiki-url=$WIKIURL migration data
Removing stale editor backups
If you want to remove the "MoinEditorBackup" files from your wiki instance, then do the following.
for i in $(find $DATA/pages -type d \ -name '*(2f)MoinEditorBackup'); do rm -fr $i done
Unlock locked files
If your wiki instance still isn't working, then you might have a stale lock file or two. Do the following to remove stale lockfiles.
for i in $(find $DATA/pages -type f -name current-locked); do echo "Removing stale lockfile in $(dirname $i) ..." mv $i $(dirname $i)/current done