Ultimate NucleusCMS to any blog migration (here, WordPress)

This is not based on migrating the database, but on keeping both systems, Nucleus and the new blogging software working, and the old one’s URLs intact (using some simple .htaccess magic) while adding the new one’s urls.

The downside is that when Nucleus has security holes fixed, you have to keep upgrading it, as well as the new one. This could be solvable by making a static mirror of the nucleus site using, say, wget. Then you could delete the old nucleus installation and just upload the static files in their place – but you would not have the posts in any semantically rich format any more – unless, of course, you backed up the old database before doing this.

This requires that you have “pretty urls” (mod_rewrite using .htaccess) enabled in Nucleus.

  1. Make a new directory for nucleus inside the current blog directory. For me, nucleus resides in /journal, so I moved all of it to /journal/old2008/: while in the directory, do: “mkdir old2008 && mv * old2008”. This will not move any hidden files intact in the old directory, but leave them (most importantly, .htaccess) intact.
  2. Do “chmod u+w config.php“, to make it possible to edit config.php
  3. Edit nucleus config.php to point everything to the new directory you just moved the files to. “/home/username/webroot/journal/nucleus/” becomes “/home/username/webroot/journal/old2008/nucleus/”. Also, add the line in italics below to config.php (this will make nucleus media/image popups work). The change will thus be something like this:
    $CONF['Self'] = "old2008/".$CONF['Self'];
    // main nucleus directory
    $DIR_NUCLEUS = '/home/username/webroot/journal/old2008/nucleus/';
    // path to media dir
    $DIR_MEDIA = '/home/username/webroot/journal/old2008/media/';
    // extra skin files for imported skins
    $DIR_SKINS = '/home/username/webroot/journal/old2008/skins/';
  4. After saving config.php, do “chmod u-w config.php“, to make Nucleus work with its new config file.
  5. Edit the .htaccess that was left in the original blog directory (for me, /journal/.htaccess) so that the ReWriteRules point to the directory where you moved nucleus. That is:
    RewriteRule ^archive-([0-9]+)-([0-9]+)-([0-9]+).php+ index.php?archive=$2-$3&blogid=$1
    RewriteRule ^item-([0-9]+).php+ index.php?itemid=$1
    RewriteRule ^category-([0-9]+).php+ index.php?catid=$1
    RewriteRule ^archivelist-([a-z]+).php+ index.php?archivelist=$1

    becomes:

    RewriteRule ^archive-([0-9]+)-([0-9]+)-([0-9]+).php+ old2008/index.php?archive=$2-$3&blogid=$1
    RewriteRule ^item-([0-9]+).php+ old2008/index.php?itemid=$1
    RewriteRule ^category-([0-9]+).php+ old2008/index.php?catid=$1
    RewriteRule ^archivelist-([a-z]+).php+ old2008/index.php?archivelist=$1

    In addition, I wanted to keep my old RSS feed URL but point it to the new WordPress feed instead:

    RewriteRule ^index.rdf+ ?feed=rss2
  6. Edit your Nucleus frontpage skin at journal/old2008/nucleus so that everything still points to the original directory. That is, since the links probably are relative, you will need to add “../” in front of them.Remember, you don’t want the URLs to change or to have double urls. The old urls will still work since you just fixed the RewriteRules in point 3., above. Only your old blog’s front page will move to journal/old2008/ (or whatever directory you moved your nucleus blog to) on the public web, since it’s old address will be occupied by the new blogging engine’s front page.
  7. Change your Global settings in Nucleus so that everything except “URL of Site” point to the directory where the nucleus blog now lives, in my case, “http://www.pilpi.net/journal/old2008/…”
  8. Install your new blogging system and edit its theme to match your old site. If it’s WordPress, you can also enable pretty URLs for WordPress in Settings -> Permalinks. WordPress is polite enough to just add its rewrite rules to the end of the existing .htaccess.

Sweet.

For an example, see my last posting on the old blog, in its original url or a posting with <%imagepopup%> used.

16 Comments

toto November 10, 2008

pas mal

Pandemic 2 June 18, 2009

thanks for this great tutorial, do you have anyway to convert from NucleusCMS to drupal?

Olli Savolainen (pilpi.net) June 19, 2009

@Pandemic2: Well, the principle is probably very similar if you want to use this. You can just take steps 1 to 7 no matter which system you are replacing nucleus with. The downside is just that with this, you have to keep upgrading nucleusCMS with security upgrades (in addition to the new system) if you don’t want to get hacked.

There are also some further tweaks I made after this, i.e. some links and images were still broken, but the fixes were pretty straightforward. If you come across something like this, let me know.

Fix July 16, 2009

thanks for this great tutorial, do you have anyway to convert from NucleusCMS to drupal?

Bikin web July 20, 2009

Thanks for the tutorial, i migrate one of my blog too, now all using wordpress.

Olli Savolainen (pilpi.net) July 20, 2009

@Fix, please take a look at my response to Pandemic2, above.

Host August 4, 2009

Thanks for the tutorial, i migrate one of my blog too, now all using wordpress.

Bas January 23, 2010

Good info, thanks. It convinced me of keeping my Nucleus installation.
For one reason, I can’t figure out why, fancyurls never worked with my Nucleus (it does with WordPress). How would the rewrite be without the fancyurl?

Olli Savolainen (pilpi.net) March 23, 2010

I also later removed all unnecessary files from the nucleus directory and blocked all access to the /nucleus/ administration panel by using .htaccess “deny from all”.

Gordon French June 26, 2010

Thanks for the information. I have an old blog I want to migrate to WordPress.

curcuna September 10, 2010

i migrate one of my blog too, now all using wordpress, thanks for the tutorial

justjoe April 18, 2012

WordPress, you can also enable pretty URLs for WordPress in Settings -> Permalinks. WordPress is polite enough to just add its rewrite rules to the end of the existing .htaccess.

and always check the .httaacess file, don’t trust wordpress too much. One time i create .httacess using it’s permalink feature, then my previous configuration doesn’t work. i use custom instalation.

Mayank Gupta October 26, 2014

If I am using the normal URL Scheme, is it still possible to use your trick?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.