nucleus2wordpress

Once I promised to release the script that I wrote while migrating from Nucleus CMS to WordPress. Well, here it is. But I doubt that you should start any serious celebrations, since this one is pretty messy and based very much on my setup. Let me try to explain a couple of things to make it easier for you.

Expectations (read: limitations):

  • This script expects that all your Nucleus tables have nucleus_ prefix and all your WordPress tables have wp_ prefix. These are the defaults anyway, so I don’t think this is much of a problem.
  • This script expects that all your Nucleus tables and all your WordPress tables are located in the same database. And I really don’t see the reason to separate them anyway. You’ll just delete Nucleus tables after migration.
  • This script expects that your WordPress upload directory is /wordpress/wp-content. This is again one of WordPress defaults, so I don’t think it will matter much.
  • This script expects that inline images in your Nucleus posts were surrounded by the <div class="leftbox">...</div> and <div class="rightbox">...</div>. If you had it differently, you’ll have to play with regexps.
  • This script expects that all authors who posted items in Nucleus have the same username (aka login) in WordPress. Since I was and will be the only user posting items, that was pretty easy for me.
  • This script expects that all categories that existed in Nucleus have the same name in WordPress. It does not create these, since WordPress has a more advanced cateogory functionality (with nesting and stuff), so you’ll have to deal with this.
  • This script does not create slugs (short-names-with-hyphens) for WordPress items, so if you are using post titles in your permalinks, they won’t work. I was (and still am, for that matter) fixing this with a bunch of other tiny script which I won’t post here for their uglyness. Find your own solution or don’t use post items in the permalinks.

Features (read: things I cared about)

  • This script migrates Nucleus posts to WordPress. NOTE: Nucleus uses two database/forms fields for the post body and extended part (aka ‘Read more’). WordPress has only body in database/forms, but provides a <!--more--> tag to separate the post in parts. My script is using this tag when combining Nucleus post parts into WordPress single post.
  • This script can migrate either all posts or posts written after the certain date.
  • This script migrates Nucleus comments to WordPress. This script will use Nucleus members information (names, URL, email) and information that was provided via comment submission form smartly. Well, as smart as works for me. :) Comments are assigned to posts based on the post time AND post title. This should be right most of the times.
  • This script tries to be as verbose as possible during the migration process, so that you always know what it does. (I consider this to be more of a feature than a limitation.)

Once again, remember that this script wasn’t written to work for the general public, since the amount of customization that can be (and usual is) done to both Nucleus CMS and WordPress is enormous. I wrote this script as a quick hack to help me with a one time task, so don’t expect much. If things go wrong, check the regexp bits first, and the SQL bits second.

Without further ado: nucleus2wordpress.pl

P.S.: If comments in the script appear strange or incorrect, consider the fact that I wrote them few days after I wrote and used the script itself…

Update: If you used this script, you might be also interested in Fixing WordPress slugs post.

knoda – KDE’s front-end to databases

knoda is one of those cool looking and functionally promising projects. If you are still looking for graphical interface for database management, then try it out.

Its driver concept allows a uniform connection to different database servers (Dbase/Xbase, MS Access/Mdbtools, Mysql , Postgresql , SQLite or ODBC).

Did you notice that MS Access was mentioned? Well, here is a little more for you to know:

New test version knoda 0.7.4-test1 released. With its latest release knoda introduces a driver for MS Access databases (mdb files). Knoda is the first KDE based database frontend reading MS Access databases natively and so it is getting closer to its goal to be a full replacement for MS Access. The driver is based on Mdbtools.

Quote of the day

Microsoft .WAV RIFF files.
These appear to be very similar to IFF files, but not the same. They are the native sound file format of Windows. (Obviously, Windows was of such incredible importance to the computer industry that it just had to have its own sound file format.) Normally .wav files have all formatting information in their headers, and so do not need any format options specified for an input file. If any are, they will override the file header, and you will be warned to this effect. You had better know what you are doing! Output format options will cause a format conversion, and the .wav will written appropriately. SoX currently can read PCM, ULAW, ALAW, MS ADPCM, and IMA (or DVI) ADPCM. It can write all of these formats including (NEW!) the ADPCM encoding.

© man 1 sox

Robots

Robots (2005)Some people might get scared away from parenthood by the dramatic decrease of number of movies that I watch recently. To keep them calm and demonstrate that it is actually possible to find some time for a movie or two, both Olga and I watched “Robots” today.

Directed by: Chris Wedge, Carlos Saldanha
Genres: Animation, Comedy, Family, Fantasy, Sci-Fi
Cast: Halle Berry, Lucille Bliss, Terry Bradshaw, Jim Broadbent, Mel Brooks, Amanda Bynes, Drew Carey, Jennifer Coolidge, Dylan Denton, Will Denton, Marshall Efron, Damien Fahey, Lowell Ganz, Paul Giamatti, Dan Hedaya
IMDB raintg: 6.4
My rating: 8.0 [rate 8.0]

Continue reading Robots