From Greymatter to Nucleus

         
 


Archief

Over Aad

PGP publickey

 

Update: 18-10-2021 16:56

What's up?

This page gives a short account of my experiences in converting the weblog Zwavelaars from Greymatter (GM) to Nucleus.

Why changing from Nucleus to GM?

Well, internally, GM is a mess. Also, with the growing number of messages on Zwavelaars, the rebuild-time kept growing as well. Also, I didn't like the way a message was stored in two seperate files. I was looking for a new weblog-tool written in PHP and using MySQL for storing the data. Pivot is based on PHP, looks good, but uses files for storing the messages. Nucleus fills all my wishes and version 1.1 doesn't have the rough edges of earlier 0.9x version.

How did I do the conversion?

Nothing special; First I tried Nucleus under a seperate account and then I did the installation procedure under my "production" account. After that, the supplied conversion tool from GM to Nucleus did a splendid job. No problems, piece of cake.

Just a few loose ends...

After using Nucleus for about a month, I noticed in my Nedstat-statistics that a lot of people found my weblog through the "old" GM-links. E.g. Google gives a link to an old message (e.g. http://zwavel.com/~zwavelaars/00000432.php) or an old archive (like http://zwavel.com/~zwavelaars/archive-092001.php). To clean the old GM-stuff as much as possible, I wanted to change the old GM-files in way they redirected the user to the new Nucleus-information. I came up with the following solution:

Fill the old "000xxx.php" files with a piece of javascript which makes the appropriate Nucleus-call. Something like http://zwavel.com/~zwavelaars/index.php?itemid=yyy. In my case, GM message "xxx", was the same as Nucleus itemid "xxx+121". With the following Unix shell-script I have converted the GM-files. This was run under Linux; Change "bash" to "ksh" on other Unix systems.

#!/bin/bash

for php in 0*.php
do

numid=$(basename $php .php)
num=$(expr "$numid" : '[^1-9]*\([1-9][0-9]*\)$')
numok=$(expr $num + 121)
echo "numid=$numid, num=$num, $numok"

cat <<END >$php
<html>
<head>
<title>Redirection</title>
</head>
<body>
<script language="javascript">
location="http://zwavel.com/~zwavelaars/index.php?itemid=${numok}"
</script>
</body>
</html>

END

done

The GM archives were named "archive-mmyyyy.php" which should redirect to "http://zwavel.com/~zwavelaars/index.php?archive=yyyy-mm&blogid=2" (blogid=2 is the blogid of my "production version" of Zwavelaars. To change these files I used the following script:

#!/bin/bash

for php in archive-*.php
do

file=$(basename $php .php)
odat=$(expr "$file" : 'archive-\([0-9]*\)$')
y=$(expr "$odat" : '.*\(....\)$')
m=$(expr "$odat" : '\(..\)....$')

cat <<END >$php
<html>
<head>
<title>Redirection</title>
</head>
<body>
<script language="javascript">
location="http://zwavel.com/~zwavelaars/index.php?archive=${y}-${m}&blogid=2"
</script>
</body>
</html>

END

done

After this, I removed all .cgi-files and, naturally, all GM-files and Perl-scripts.

All in all, I converted to Nucleus without any real problems. If you have any questions, feel free to send me an email.