Step-by-step iBlog to WordPress

I talked about doing it, and even tried out the some of the theory. Eleven months later I did it. This is a reconstruction of the process I went through in migrating from iBlog to WordPress. In the best tradition of reconstructions it is put togther partly from hand-written plus typed notes, old screen captures, lots of coffee, and reliance on memory. Apologies if it seems a bit dis-jointed. I should have gotten to it sooner, but you know how it is…

Update 03.04.09: Migrating from the perpetual iBlog 2 RC? Check out the iBlog Survivors forum, including Jerry’s export script. As icerabbit notes, iBlog 1.x users could also employ this script after importing to iBlog 2.x as an intermediary stage.

Alternative post title: “Crossing to the Server Side”

WordPress.com or WordPress.org?

Having decided on WordPress, the next step is to decide if you want hand-holding (.com) or wish to bring the warp core online and experience the full power of a DIY install (.org). In a nut shell, with a WordPress.com hosted account you get:

  • Blog stats (but you can add this functionality to a DIY installation);
  • Askimet plug-in activated (but you can activate it for DIY using a free API key.

More important is what you don’t get relative to a DIY installation:

  • The ability to import your posts from previous blogging systems;
  • The ability to use plug-ins of your choice;
  • The ability to edit (and create new) custom themes.

The choice is yours. Sometimes being constrained is a good thing (i.e. you have better things to do than tweak code ’till the early hours); other times it is a bind. If you chose the .com option you’re done reading here. Otherwise, if you dare, read on…

(A) Create a WordPress development environment

Mamp Small

  1. Download and install the MAMP local server environment. MAMP stands for Mac/ Apache/ MySQL/ PHP;
  2. Follow Doig’s instructions to install WordPress 2 into MAMP/htdocs;
  3. Create a folder MAMP/htdocs/wp-content/uploads/iblog (we’ll use this soon to store images from our iBlog entries).

Tip: Use http://localhost:8888/MAMP/?language to open the start page if the widget button doesn’t work.

MAMP makes for a great playground in order to experiment with different plug-ins and themes, to learn about PHP, and to tidy up all that invalid markup generated by iBlog.

(B) Export Entries from iBlog 1.4.x

  1. Download Agitprop;
  2. Follow the instructions here to export your data from iBlog. Agitprop’s export file is in Movable Type Import Format;

    Agitprop

  3. Rename the exported media folder to “iblog” and move it into htdocs/images/;
  4. Rename the exported blog entries file to import.txt.

At some point (I regret I can’t recall at which stage, you’ll likely need to update your image URLs using search-and-replace to point to the new server. For example http://homepage.mac.com/your.name/images/mypic.jpg might become http://your.domain.net/wp-content/uploads/iblog/mypic.jpg

(C) Import Entries (Posts) to WordPress

  1. Go to Dashboard > Import > Movable Type > Choose File and select import.txt;
  2. Click Import then select user and Submit;
  3. Wait a while.

(D) Import Haloscan comments

Note that you need to be a premium HaloScan member for this to work (i.e. you paid over $US12).

  1. Download Justin’s PHP script here;
  2. Put the script into /Applications/MAMP/htdocs/wordpress/wp-admin/import-haloscan.php;
  3. Put your Haloscan export file into /Applications/MAMP/htdocs/wordpress/export.xml;
  4. Inside this XML file is a line of syntax like <thread id=”E880959544″> for each post that has comments—this code is important;
  5. Edit each post with the following comment, inserted just before the first line of the post (this position is important!):

    <!–E880959544–>

    iDVD 3 does not produce PAL widescreen…

  6. To get this number mouseover an iBlog post with comments. You’ll see this:

    Picture 3

  7. If you right-click on “Comments” you can copy this URL:

    javascript:HaloScan(‘E880959544′);

  8. Paste this into the corresponding WP post (via the web interface or using ecto—see below) and edit the line to:

    <!–E880959544–>

  9. Now run the script by adding /wp-admin/import-haloscan.php to the localhost address in your browser;
  10. Once the import is done you can delete the HaloScan comment from the post, but this is optional as it does no harm—unless you import again, in which case you’ll get duplicate comments!

One minor hitch is that your imported comments aren’t registered in the WP count unless you edit them; just clicking “Edit comment” without doing any editing for one comment is enough to register all comments in that post.

(E) Edit imported entries with ecto

  1. Download ecto;
  2. Add an account for your WP installation:

    Ecto1

    Ecto2

  3. By default ecto will download the 20 most recent entries, but you can increase this number to download all your posts for editing.

I ran into a problem whereby ecto would not upload images; the WP 2.0.1 update fixed this.

(F) Choose a new web host

.Mac doesn’t support PHP, so I had to look elsewhere. DreamHost seemed popular, and proved responsive and accurate in answering my pre-sales questions. Compared to attractions of .Mac DreamHost had a number of additional advantages:

  • Cheaper ($US7.95 pm over 2 years vs. $US10.25 pm for .Mac + iLife 06);
  • More e-mail accounts (3000 vs. 1);
  • More storage (20 GB vs. 1 GB);
  • More bandwidth (a minimum 1 TB pm vs. 10 BGB pm)
  • A free domain (vs. no domain);
  • A Jabber chat server (vs. none).

Like .Mac it also offers WebDAV and web-based e-mail. If you want to sign up (sure you do), then say I sent you by clicking here.

Update 04.08.06: DreamHost proved unreliable; this site has moved hosting to (mt) Media Temple.

Whoever you choose, install PHP, MySQL, and of course WordPress (which I installed into the server’s root directory).

(G) Migrate from MAMP to the outside world

I can barely read my chicken-scrawl here, but for DreamHost you can follow these instructions to make a dump of your current (MAMP) database and restore it on DreamHost’s servers.

  1. I seem to recall it was easy enough to use phpMyAdmin (included with MAMP) to export the database (my export was named wordpress.sql). I used Transmit, an FTP client, to upload this file to the root directory of my DreamHost account:

    Sql

  2. It’s important that you create a new WordPress database on the live server (DreamHost made this bit easy) before you try importing anything into it. Go figure;
  3. I then used Terminal to log on to my server. The syntax goes like this:
    ssh username@your.domain.com
  4. Enter your password when prompted and (at least in my case) you should arrive at the [temple]$ prompt;
  5. To import the old MySQL database containing your WordPress posts etc., use this syntax:
    mysql -h mysql.example.com -u username -ppassword newdbname < wordpress.sql

(H)ope it worked!

There’s lots to play with now. But beware of developing a medical condition I’ve named “coder’s elbow”:

Coders-Elbow

This is an inflammatory dermatitis induced by prolonged contact between the skin of your elbows and your desktop.

21 thoughts on “Step-by-step iBlog to WordPress

  1. Justin Watt

    Bruce, a note regarding:

    One minor hitch is that your imported comments aren’t registered in the WP count unless you edit them…

    I updated import-haloscan.php so that comment counts are correctly displayed in WordPress 2.x. At least that’s one less hitch in the process.

  2. TriangleJuice

    Bruce, this story is fantastic (mostly because it really happened)! I guess I did it the hard way when I moved from iBlog to WordPress: copy-paste ;-)

    BTW, I really like the thing you did with the preferences panel. Very nice!

    Cheers!

  3. Stef

    Hi,

    thanks a lot for the workflow! Helped me a lot.

    But did you encounter any problems with the filenames of uploaded images?

    It seems that agitprop does rename files (like photos) which have the same name. So, if I have in two different folders a file with the name DSC_0001.jpg, agitprop renames them into DSC_0001-1.jpg etc….

    But it does not reflect these changes in the articles, which I find than in the txt -file… So, here I have to change that manually? Gush…. over 500 articles with lots, lots, lots of photos….

  4. Bruce Post author

    Stef it’s a while ago now but, yes, I seem to remember having to rename a lot of images. As well as changing the file name I had to update the URL in the post accordingly—checking each post thru one-by-one. Being prolific counts against you here!

  5. rick

    Bruce,

    I was able to get all my posts over as well as the pictures. although I had to edit each picture file to the new location on my server, not really too hard. I am finding it impossible to import the comments. I have the script and comment file uploaded okay and am able to run it but I get a no comments uploaded after I am done. Do I have to add the comment number to each and every post from my old iblog to each and every corresponding wordpress post?

    Any help or instructions in plain noob english would be apreciated.. Up to the comments part the instructions were spot on by the way.

  6. Bruce Post author

    Hi Rick,

    It’s been a while and my wetware databanks are struggling with this. But I believe you have the correct idea:

    [quote comment="75608"]Do I have to add the comment number to each and every post from my old iblog to each and every corresponding wordpress post?

    So you should have two files on your server—import-haloscan.php (PHP script from Justin) and export.xml (Haloscan XML file). Before running Justin’s script you need to copy the thread id no. from the XML file (or, easier still, from a live iBlog site) and paste this in a comment container at the very top of each corresponding post in WordPress (steps D: 5-8 above). It may be a lot of work: only you can decide if it’s worth it.

  7. Larry Hollon

    Bruce,
    Thanks for this set of instructions. I’ve managed to migrate my files from iBlog to WordPress. But I haven’t figured out how to redirect visitors from .mac to my new doman. Do you have information about how to do a redirect from .mac?
    Thanks.
    Larry

  8. Bruce Post author

    Larry, your best best is to replace your .Mac index page with a JavaScript redirect. They’re easy to implement (e.g. see here) and 100% .Mac compatible (no need to change DNS settings or rely on PHP or .htaccess scripts). Of course, this only works so long as your .Mac account is active; if it expires there is no re-direct option I know of.

  9. Cher

    I was thrilled to find your step by step guide, one problem though, the link to Agitprop is dead. Can’t find the app anywhere. Do you have any suggestions on where to find it or alternate solutions? Thanks, Cher

  10. Larry Hollon

    Cheryl,
    I don’t know the copyright status of Agitprop. I believe it is not a copyrighted program. I cannot locate a website to determine this but as I recall it was an “open source” application. If I’m incorrect perhaps someone can correct me as I don’t want to violate anyone’s copyright. If it is open source, or public domain, the application is in my public folder on dot Mac [here].

  11. icerabbit

    Coincidence? Or not?

    In the past week I’ve talked with some people about exporting, I swing around today and you just updated this entry yesterday with a comment with a new active link.

    You’re good!

  12. Bruce Post author

    Coincidence, yes. I responded to someone on the ecto support forum who was asking if ecto could import direct from iBlog, wishing him luck in finding Agitprop. I decided to search myself and found the link. Gotta love Google!

  13. Cher

    I thought I’d check on Agitprop here after all these months. What a surprise, it’s right here! And in my app folder as we speak, THANX!

Comments are closed.