KFR-Wiki-Migration 2017

Worum geht es?

Das mindestens 6 Jahre alte Wiki der Kantonsschule Freudenberg soll migriert werden, damit es weiterhin zuverlässig und sicher läuft. Bei dieser Migration ändert folgendes:

  1. Zugrundeliegender Linux-Server (von X nach Y)
  2. Zugrundeliegender Foswiki-Server (von Foswiki-1.1.3, Sat, 16 Apr 2011, build 11475 auf Foswiki-2.1.4)
  3. Wechsel der Zeichencodierung von ? auf UTF-8
  4. Wechsel der zugrundeliegenden Versionsverwaltung von RCS auf Plain File
  5. Wechsel vom Pattern-Skin auf das Nat-Skin

Punkt 1 ist der Auslöser, da für das alte Linux keine Updates mehr verfügbar sind. Punkt 2 bringt Usability- und Geschwindigkeitsvorteile. Die Punkte 3 und 4 vereinfachen künftig den Betrieb, sind aber jetzt in der Migration mühsam.

Foswiki 2.1.4 Basisinstallation

Foswiki anpassen

  • Benötigte CPAN-Module
    • Email::MIME
    • BerkeleyDB
    • Sereal
    • Time::ParseDate
    • Algorithm::Diff
    • Algorithm::Diff::XS
    • Text::Unidecode
    • Image::Magick
    • Archive::Zip
    • Locale::Maketext::Lexicon
    • I18N translations Locale::Msgfmt
    • Date::Calc
    • HTML::CalendarMonthSimple
  • Folgende Plugins installieren:
    • EditChapter
    • NatSkin
    • CalendarPlugin

Datenmigration Foswiki 1.1.3 auf 2.1.4

Bei der Migration wird der Zeichensatz von XY auf UTF-8 geändert und RCSwarp durch PlainFile geändert. Dafür existiert ein Skript tools/bulk_copy.pl, das aber dummerweise nicht direkt auf den Files operiert, sondern auf dem Perl der alten und der neuen Wikiversion. D.h. es muss einen Server geben, wo gleichzeitig die alte und die neue Wikiversion läuft (Details siehe https://foswiki.org/System/UpgradeGuide#Alternative_1:_Convert_the_data_using_61tools_47bulk_copy.pl_61).
    iweb       => [], # List of webs to include (empty implies all webs)
    xweb       => [], # List of webs to exclude
    itopic     => [], # List of topics to include (empty implies all topics)
    xtopic     => [], # List of topics to exclude
    latest     => [], # List of topics for which only the latest is to be copied
    quiet      => 0,  # shhhh
    debug      => 0,  # OMG
    check_only => 0,  # If true, don't copy, just check

  • Pfad alte Installation: /home/webhomes/wiki.kfr.ch/htdocs/
  • Pfad neue Installation: /home/jail/srv/www/kfrwiki2.cyberhome.ch/htdocs/

IRC-Hilfestellung

[17:17] == foswiki_irc7 [55039921@gateway/web/freenode/ip.85.3.153.33] has joined #foswiki
[17:18] <foswiki_irc7> Hi, I've got problems with the bulk_copy.pl migrating from foswiki 1.1.3 to 2.14
[17:19] <@gac410> Hi foswiki_irc7    When migrating from old foswiki,  you might be better off using the CharsetConverterContrib.     bulk_copy is not very forgiving or data/topic issues.
[17:19] <foswiki_irc7> The script is printing several perl errors regarding the old server.
[17:20] <foswiki_irc7> It doesn't even start ...
[17:21] <foswiki_irc7> It ends with several errors in configure/Load.pm
[17:21] <@gac410> Are you tryhing to run a copy of Foswiki 1.1.3 on the new server with a new perl?
[17:22] <foswiki_irc7> Is it a problem, that on the new machine I've got perl 5.24 where on the old server I've got perl 5.10
[17:23] <foswiki_irc7> I'm only trying to run buk_copy.pl with the new perl, yes.
[17:23] <@gac410> Unfortunately there will be no way to get Foswiki 1.1.3 to run on perl 5.24.    There are a lot of perl issues in the old foswiki.   Perl language has changed.
[17:23] <foswiki_irc7> Oh shit...
[17:23] <@gac410> You'd have to upgrade  from foswiki 1.1.3 to 1.1.10 first,       But CharsetConverterContrib is a much better solution.
[17:24] <foswiki_irc7> does CharsetConverter also help me to get rid of RCS?
[17:24] <foswiki_irc7> and to change to plainfile?
[17:24] <@gac410> With it,  you don't have to run Foswiki 1.1.3.    You copy your data unmodified into your new Foswiki 2.1.4 installation.  And then run CharsetConverter to convert to unicode / utf-8
[17:25] <@gac410> No.   CharsetConverter only converts to unicode/utf-8.    But once you get your data converted,  you could then use bulk_copy to convert the store.
[17:25] <foswiki_irc7> Thanks, I'll try that!
[17:26] <@gac410> Just be warned that bulk_copy depends upon the old RCS history to be pretty much perfect.   And things like auto-attachments, and hidden attachments  ( .dot files,  and _hidden files, and subdirectories )   are skipped.
[17:26] <foswiki_irc7> at least I have none of theese... ;-)
[17:27] <foswiki_irc7> but I'll try CharsetConverter on the new server
[17:27] <@gac410> You want to be certain you  never convert a web twice.   Once it's utf-8,  converting it again will corrupt it.
[17:28] <@gac410> And best to tell charset_converter that your old encoding is cp-1252.   That is assuming you have windows users who might have cut/pasted into topics while editing.
[17:28] <foswiki_irc7> thx. I've read that
[17:28] <foswiki_irc7> Yes, I have windows users...
[17:30] <@gac410> There is a hidden twisty section at https://foswiki.org/System/UpgradeGuide#Alternative_2:_Convert_data_using_CharsetConverterContrib    that gives step-by-step
[17:32] <@gac410> CharsetConverter is **much** faster,   bulk_copy has to copy each revision,  one at a time.   On topics like WikiUsers,  and WebStatistics,  that can be 1000's of revisions.
[17:33] <@gac410> So when you eventually do run bulk_copy,  you might consider killing off the *,v files at least for topics where you don't need/want history.   That will speed it up.
[17:37] <zak256> I guess RcsLite is preferable over RcsWrap? Installed rcs is no problem but I don't know which is faster.
[17:37] <zak256> Right now I selected RcsLite, but sometimes it takes longer to load when clicking on "Edit". Don't know if that is related though.
[17:38] <@gac410> zak256:   as usual, "it depends" :D     for edit,  rcs lite vs. wrap should not matter.  You are not accessing the older version of the topic.
[17:38] <zak256> ah... of course.
[17:39] <@gac410> rcsLite is preferred for mod_perl and fastcgi.      rcsWrap forks,  which is expensive.    But generally  the compiled C code in system rcs,  will be faster than the perl code when processing a history file.
[17:40] <zak256> Hmm... maybe I will just make some tests.
[17:40] <@gac410> rcs in general, and rcsLlite in particular are very bad with attachments,  especially binary attachments, where a "diff" doesn't make sense.
[17:42] <@gac410> PlainFile has some downsides.  It's fast, but you must never "touch" the txt files themselves.  They use the file system modified date/time as part of history.  Modifying the file timestamp can do bad things.
[17:42] <zak256> Yes... I skipped migrating to PFS for now.

Fazit: Das bulk_copy-Skript funktioniert nicht. Empfehlung: Mit der Charset-Convert-Methode auf dem neuen Server alle Files auf UTF-8 migrieren. Danach evtl. inplace mit dem bulk_copy-Skript RCS loswerden.

Somit zweischrittiges Migrieren mit Zwischenserver

  • Auf dem alten Server liegen die Daten non-ut8 und RCS
  • Auf dem Migrationsserver werden sie nach utf8 gewandelt mit charsetcontrib
  • Auf dem Migrationssever werden sie mittels eingebundenem directory des neuen Servers auf plainfile umgewandelt.

D.h. während der Migration sind die Daten gleichzeitg an drei Orten gespeichert
  • auf dem alten Server (weil der weiterläuft)
  • auf dem Migrationsserver
  • auf dem neuen Server

Nachdem ein Ordner migriert worden ist, kann er auf dem Migrationsserver wieder gelöscht werden.

0. Files auf den neuen Server kopieren

Mit scp die Files auf den Migrationsserver (!) kpieren

1. Charset Migration mittels CharsetConverterContrib

Im vVerzeichnis /srv/www/migration/htdocs/tools mit dem folgenden Befehl

perl convert_charset.pl -web=LICEO -i -encoding=cp-1252

Vorsicht: Nur einmal pro Web!

2. Auf dem neuen Server bulk_copy.pl ausführen

cd /srv/www/migration/htdocs/tools
perl bulk_copy.pl --iweb LICEO /srv/www/migration/htdocs/bin /srv/www/kfrwiki2.cyberhome.ch/htdocs/bin

Pfade auf dem Migrationsserver

  • Pfad alte Installation: /home/webhomes/wiki.kfr.ch/htdocs/
  • Pfad Migrationsinstallation: /srv/www/migration/htdocs
  • Pfad neue Installation: /srv/www/kfrwiki2.cyberhome.ch/htdocs

Aktueller Stand

  • Das bulk_copy-Skript motzt beim SAP-Web öfters, dass es nur die Version 1.1 des Attachments kopieren könne, weiss aber noch nicht, ob das ein Problem ist. Werde es mit dem LICEO-Web testen.

Fazit Donnerstag: RCS bleibt.

  • Nur Umstellung des Charsets auf UTF-8, hingegen bleibt RCS bestehen, da selbst foswiki.org noch mit RCS läuft.

Migrationsstand

Web Stand
SAP migriert
KFR migriert
Main migriert
LICEO wird nicht migriert

Update 2019-11

Im November 2019 einige Updates gemacht. Dabei auch DBCachePlugin aktualisiert. Danach Fehlermeldung Undefined subroutine &Foswiki::Plugins::DBCachePlugin::getTopicTitle called bei jedem Aufruf einer Wiki-Seite.

Abhilfe schafft:

A quick fix for you is to fix the offending line 71 in lib/Foswiki/Plugins/NatSkinPlugin/HtmlTitle.pm by replacing

Foswiki::Plugins::DBCachePlugin::getTopicTitle

with

Foswiki::Func::getTopicTitle

http://foswiki.org/Support/Question1942

    • In der Datei MAKETEXT.pm drei Zeilen gelöscht, um Fehlermeldung zu vermeiden (viewfile: Argument "1.26_01" isn't numeric in numeric lt (<) at /srv/www/mia.phsz.ch/htdocs/lib/Foswiki/Macros/MAKETEXT.pm line 46). (gefunden bei MiaPhszMigration wink )
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding arbeitsgruppe.ch? Send feedback