MigrateToMediaWiki: Difference between revisions

From T2B Wiki
Jump to navigation Jump to search
Line 50: Line 50:
<li>Now you have to initialize the wiki. Go to the URL you have created :
<li>Now you have to initialize the wiki. Go to the URL you have created :
<pre>
<pre>
[http://mona.iihe.ac.be/wiki/test]
<a href="http://mona.iihe.ac.be/wiki/test">http://mona.iihe.ac.be/wiki/test</a>
</pre>
</pre>
and follow the instructions.
and follow the instructions.

Revision as of 09:54, 27 August 2015

The plan of the migration

Here are the steps :

  • creation of a new Apache webserver called "mona" with Quattor
  • moving all the Trac wiki's to mona
  • conversion of the Trac wiki's to MediaWiki (thanks to a homebrewed script)
  • once everything is ready, switch to the new webserver in the DNS servers

Creation of the new webserver

It is a virtual machine with 60GB of disk size (see the hardware template hardware/machine/Virtual/virtual_kvm_mon for more details). The software configuration is done through the template config/t2b_docu_server.

Moving the Trac wiki's to the new webserver

For each wiki that was on the old mon server, create a new wiki on the new webserver with the trac-admin command. For example :

trac-admin /var/www/trac/t2b initenv

On the old webserver, you make a copy of each wiki to a nfs-shared directory. Going on with the previous example, it gives something like this :

trac-admin /var/www/trac/t2b hotcopy /userbackup/sgerard/trac_backup_20-08-2015/t2b

Now, going back to the new webserver, we can simply overwrite the content of /var/www/trac/t2b with the content of the back-up copy :

cp -a -p /userbackup/sgerard/trac_backup_20-08-2015/t2b /var/www/trac/

(Of course, it works because the nfs-share where the backup copy was done on the old server has been mounted on the new webserver thanks to Quattor ;-)

Conversion from Trac to MediaWiki

For each Trac wiki that you would like to migrate, you have to create a new empty MediaWiki. I won't explain all the details here, but instead, I'll just say that I first followed this, and then, when I realized that this recipe was valid for a single MediaWiki, I moved to this one, that seems to me easier and closer to what I want.

Here are steps to create a wiki "test" :

mkdir /var/www/mediawiki199/test
chown apache:apache /var/www/mediawiki199/test
cd /var/www/mediawiki199/test
ln -s /usr/share/mediawiki199/* .
rm LocalSetting.php AdminSettings.php images mw-config
cp -a /usr/share/mediawiki199/mw-config .

Now, for each wiki, the next step is to export all the pages in txt format, convert them in MediaWiki format, and then import the converted pages in the corresponding MediaWiki. To avoid hours of tedious manual tasks, a script has been created, and it is available on our SVN "scripting" repository : http://mon.iihe.ac.be/repos/scripting/mon/convert_trac_to_mediawiki/. Here is an example showing how to use it :

  1. The following commands will create a blank new wiki :
    ssh mona
    svn co http://mon.iihe.ac.be/repos/scripting/mon/convert_trac_to_mediawiki
    cd convert_trac_to_mediawiki
    ./export_all_pages.pl /var/www/trac/t2b /var/www/mediawiki119/t2b
    
  2. Now you have to initialize the wiki. Go to the URL you have created :
    <a href="http://mona.iihe.ac.be/wiki/test">http://mona.iihe.ac.be/wiki/test</a>
    

    and follow the instructions.

Sources


Template:TracNotice