Skip to content

Olli: Lived and Living

  • beginning
  • journal
  • poems
  • quotations
  • photos
  • visual
  • päiväkirja
  • runot
  • lainatut runot
  • lainattua
  • novelli

Ultimate NucleusCMS to any blog migration (here, WordPress)

Posted on August 25, 2008May 6, 2015 by Olli

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.

Posted in in English, tech

Tagged in English, tech

Post navigation

Every Bunny Needs Some Bunny
Life is an insane dream

17 thoughts on “Ultimate NucleusCMS to any blog migration (here, WordPress)”

  1. Pingback: Importing Content another blogs to Wordpress | Guide for Blogs and Wordpress
  2. toto says:
    November 10, 2008 at 02:40

    pas mal

  3. Pandemic 2 says:
    June 18, 2009 at 23:37

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

  4. Olli Savolainen says:
    June 19, 2009 at 09:21

    @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.

  5. Fix says:
    July 16, 2009 at 06:37

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

  6. Bikin web says:
    July 20, 2009 at 13:28

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

  7. Olli Savolainen says:
    July 20, 2009 at 22:18

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

  8. Host says:
    August 4, 2009 at 23:50

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

  9. Bas says:
    January 23, 2010 at 15:09

    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?

  10. Olli Savolainen says:
    March 23, 2010 at 23:49

    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”.

  11. Gordon French says:
    June 26, 2010 at 16:35

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

  12. Pingback: Source and Code » Blog Archive » Importing other blog content to WordPress
  13. curcuna says:
    September 10, 2010 at 21:14

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

  14. Pingback: Importar el contenido de otros blogs en Wordpress « La comunicación en las organizaciones
  15. justjoe says:
    April 18, 2012 at 15:54

    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.

  16. Mayank Gupta says:
    October 26, 2014 at 12:58

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

  17. Labkom99 says:
    May 8, 2021 at 17:02

    need more explain use your tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Proudly powered by WordPress | Theme: MiniZen by Martin Stehle.