LiveJournal to MovableType Migration HowTo

This article seeks to explain the painful process of migrating from LiveJournal to MovableType.

The first thing I needed to do for this was to import all the entries from my LiveJournal (LJ) to my MovableType (MT) blog.

Amanita.net has an excellent guide on how to do this. I just followed it step by step. The only thing I did, that she did not tell me to do was to set the category for all imported post to “Livejournal” at the Import Entries page, by choosing the option from the drop down menu for the same.

Update : There is another alternative that I found over at ScriptyGoddess which allows one to drag and drop the exported LJ entries XML file, and get the MovableType importable files in a jiffy. It is javasript powered. The script and the instructions are available here. Pretty neat.

Now once I was done with importing all the entries, I needed to figure a way to reflect, or mirror the two blogs (LJ and MT).

There are several options, depending on your needs. You could :

1) Continue posting on LiveJournal (LJ) and have those posts updated on your MovableType (MT) blog via the MTRSSFeed plugin.
The problem with this is that it is static content on your MT page. It does not create a new MT entry. This cannot be archived. Also, if you are using this to have your entire LJ post show up on your MT blog, you might want to change the synopsis as follows :

find the required lines and change as shown in bold

add a </a></br> after </MTRSSFeedItemTitleExists>
and change ….state=”0″ to state=”1″ in the two places it occurs in the code

I tried to include the whole code here, but when I post to the blog, MT thinks its valid code and so I cant see it there!! So I had to make it this way.

Once you have made these changes, You can include the code in your MT blog where you want to see the LJ post “imported”. If you want to import more than just the latest LJ post, you can do that by changing the lastn=”1″
to lastn=”x”, where x is the number of latest entries you want to display.

2) Start a syndicated feed of your blog at your livejournal synidcated feeds page, which ends up looking like my LJ syndication page (which I setup in the course of writing this article, and which might not have any articles, since it takes time to get going), or in general, like the Kuro5hin.org syndicated feed.

As you can see the problem is that it has to have a new LJ username, “carthik” in my case, and your friends will all have to add this feed as a friend, and you can not receive the comments in the mail, and it doesn’t look good.

3) You can post on MT and have that show up on LJ.

I found that this would be the best option, since
a) When I post on MT, I can decide the category and also archive it for later
b) I can continue to receive comments at the LJ, since updates show up as new posts, which can be commented upon.

To post on my MT blog and have it show as a new entry on LJ, I used the mtsyn perl script available at the GDS mirror. Mysteriously Sungo’s Sourceforge page does not have this script anymore. I don’t know why the author discontinued the script.

This script works fine the way it is. What you have to do is to login to an ssh account (or if you have a Linux terminal, you could execute the mt2LJ.pl script locally) and execute the script after installing all the modules it requires.

I made some changes to suit my needs.
a) As it is now, the program only checks for new posts to update to LJ in a specific category. I made changes to the script so that it updates the LJ with the new post, irrespective of the category.

b) I modified the program to run in the background, and added some code so that it checks for new updates every x minutes, where the value of x is decided by me.

UPDATE:
c) I modified the localtime(time) code in the posting to LJ section to
localtime((time() – (3600 * 6)))
to account for the fact that the localtime in the server that I use to execute this script is ahead of EST by 6 hours.

You could schedule a cron job to run the mt2LJ.pl script at a particular interval. I wrote the code I did because I found no way to have a cronjob run every 6 hours.

This is my first shot at perl programming, and I don’t know too much php either. So I could not make too much sense of an alternate method suggested by RevJim.Net. This is the php code he has made available.

I found this process very interesting, and I was overjoyed to see it all work, in the end. Programming is just another word for good magic :)

If you have any problems in doing any of the above, please let me know, and I will do what I can to help you out. I might revise this article in the future, based on feedback, if any.

This entry was posted in Livejournal and tagged . Bookmark the permalink.

3 Responses to LiveJournal to MovableType Migration HowTo

  1. This is it this is it!! says:

    Hey whats up?? i am looking for an online journal is htis one ne good??

  2. Meredith says:

    I will note that the reason I didn’t tell you to set the category to Livejournal is because that is a personal preference – not everybody would want it, so I don’t include it as part of the tutorial.

    Thanks for the thoughts on updating the LJ from MT, I’m glad you’ve found a solution that works for you. I’m still trying to find a way to incorporate the transmission to LJ with the MT rebuild – that way it could function as an MT plugin, rather than requiring a cron job or regular checking, etc.

  3. Carthik says:

    You amaze me :)
    I understand the reasons for your not specifying the setting the category to Livejournal thingy. Its just that I did it that way and so I thought of mentioning it.

    Incidentally, the reference I made to http://revjim.net in the post shows that he has a method by which the LJ gets updated each time there is a new post by means of adding a new ping address, which, I believe points to a PHP page which takes care of the LJ updating. While this is neat, he has made available only the code, and has not mentioned how exactly to do it…
    The code is given here…
    http://revjim.net/mttolj/ljpost.phps

    Do let me know if you figure it out, cause then, as you said, there will be no need for any additional cronjobs or any such.