rusty_halo (
rusty_halo) wrote2008-04-04 05:04 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Entry tags:
rusty-halo’s Guide to Migrating from LiveJournal to WordPress
In this guide:
- Why Leave LiveJournal?
- Why WordPress?
- Step One: Set Up Your Own Webspace and Install WordPress
- Step Two: Customize WordPress to Get the Look You Prefer
- Step Three: Migrate Your LiveJournal Archive to Your New WordPress Blog
- Step Four: Customize WordPress to Get More Features
- Other Guides
- Updates Since Original Posting
Why Leave LiveJournal?
There are a million and one reasons to leave LiveJournal, including: its features are outdated, it censors its users, and its customer service is terrible.
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I'm not really interested in debating the issue any further.
Why WordPress?
I chose WordPress because it has nearly every feature I liked on LiveJournal, and in most cases the WordPress version is better. Anyone can contribute to WordPress by writing a "plugin" that adds new features, and it's incredibly easy to install plugins on your blog. This means that users don't have to wait for the developers to create a long-awaited function; chances are another user has already done it. (Browse the WordPress plugin directory to get an idea of what is out there.) I'll explain below which plugins I chose to replicate LiveJournal functionality on my WordPress blog.
The one thing you can't replicate on WordPress (yet) is custom friends filters and the ability to syndicate filtered content (a la the LiveJournal "friends list"). This is why I am still cross-posting to LiveJournal and InsaneJournal--to take advantage of their filtering capabilities. Otherwise my readers would never know I had posted protected content unless they came to my blog directly. (Update: this can be done with Disclose-Secret in conjunction with Role Manager.)
Still, I feel much better now that my content is hosted on my own server, where I have complete control.
Step One: Set Up Your Own Webspace and Install WordPress
- First, you need your own webspace. This is easier and cheaper than it sounds. There are a million and one web hosts out there, so ask your friends, or spend some time on Google finding one that's right for you. (It's generally a good idea to read reviews and see what other people are saying, rather than buy into a company's advertising hype.) Just make sure it meets WordPress's requirements (mainly PHP and MySQL). If it helps, the host I use is A Small Orange.
- You also need a domain name. Your webhost might offer a package deal that enables you to register a domain with them when you get your hosting, or you can use another service. I've been using GoDaddy, because they're super cheap.
- Once you get that set up, you need to install WordPress. As I'm writing this, the latest version of WordPress is 2.5, but the one I'm using is 2.3.3. This guide is written with 2.3.3 in mind; I don't know if everything will work for 2.5. Here's where you can download older versions of WordPress.
Installation is very easy. Just follow their Installation Guide. - That's it! You're set! You can use WordPress out of the box, or read further to see about customizing it...
Step Two: Customize WordPress to Get the Look You Prefer
The first thing you'll want is probably a theme to make your blog look cool. WordPress has a huge selection of free themes. Browse themes here, or search on Google for more. The one thing I'd recommend is to make sure that your theme is "widget ready," because widgets offer a nice easy way to drag and drop elements into your sidebar. You can select this as an option when you browse.
Themes are incredibly easy to install. Download a theme, upload it to the "wp-content/themes" directory, and turn it on under "Presentation" in your WordPress admin section. Upload as many as you want, and switch back and forth until you're happy. With a bit of CSS and/or HTML knowledge, you can also edit your theme until it's exactly what you want. Here's WordPress's Theme Guide.
Step Three: Migrate Your LiveJournal Archive to Your New WordPress Blog
Believe it or not, it's actually pretty simple to duplicate your LiveJournal on your own blog. (And you'll never have to worry about getting TOS'd for having "incest survival" in your interests list!) Here's what to do:
- Export your LiveJournal into XML. Here's a list of programs you might use. I used LJ Archive, which only works on Windows. (You'll find more info on LJ Archive here and here.)
If you're using LJ Archive, you need to make an archive of your LiveJournal. Then export it in XML format by going to "File" -> "Export to XML." Here's a screencap. - Now that you've got an exported file, import it into WordPress. In the WordPress admin section, go to "Manage" -> "Import" -> "LiveJournal." (If your XML file is too big, you may have to split it up and import each year individually.)
The built-in WordPress importer will import posts and comments, but not the associated metadata like tags, moods, music, or privacy settings, and the comments will not be threaded.
(Power users may at this point want to think about whether they're going to install a threaded-comments plugin [see below] and whether they want to hack the LJ Importer to import comments in threaded form. LJ Archive's export file includes the parent comment ID, but WordPress doesn't import it. It probably wouldn't be too hard to hack the import functionality to get the parent ID; I wish I'd thought of this before I imported my journal! ETA: here's how.) - I don't know an automated way to get your tags back, but you can install the Simple Tags plugin and it'll be much easier to paste your tags back in. (See the next section for how to install plugins). Once you've got the plugin, just go to "Manage" -> "Mass Edit Tags." You can sort by date and display 200 entries per page, then copy and paste the tags from your LJ entries.
Since you've already exported your LiveJournal into an XML file, you may want to copy the tags from that, or open the XML file in a program like Access or Excel. Or just browse through your LiveJournal archives to copy the tags directly. - You'll need to query your database (I'm using phpMyAdmin) to fix the privacy settings and subjects. If you're not sure how to do that, you should probably just update the posts manually. Then scroll down to Step Four.
But if you're a power user, there's a quicker way. First, use phpMyAdmin to export your database so you'll have a backup in case anything goes wrong. Then...
To get your privacy settings back, open the XML file that you made with LJ Archive in a database program like Access or Excel. It should display all your post data in columns. Sort it by the privacy column so that all the private, filtered, and locked entries are at the top. Then select the date fields for only the entries you want to make private (in Excel you can just copy/paste; in Access you might have to export the column after deleting all the public entry rows).
Paste or open it in a text editor. You should have a long list of dates, separated by line breaks. Now, you'll need a text editor that can find/replace line breaks; search on Google if you don't have one. (I'm using an ancient version of HomeSite. I think TextWrangler will do it on a Mac.)
Find/Replace the following, where (linebreak) is you pressing "enter" on your keyboard:
(linebreak)
with
(linebreak)
UPDATE wp_posts SET post_status='private' WHERE post_date = '
(If you didn't use "wp_" as a table prefix, replace "wp_posts" with whatever your posts table is named.)
Then, find/replace:(linebreak)
with
';
(linebreak)
You should end up with a bunch of lines that look something like this:
UPDATE wp_posts SET post_status='private' WHERE post_date = '2008-03-28 16:17:46';
UPDATE wp_posts SET post_status='private' WHERE post_date = '2003-06-03 16:23:00';
You'll need to fix the first and last entries, because the copy/pasting won't have worked for them.
Then go into phpMyAdmin, click your WordPress database, go to "SQL," and paste the entire text file into it. And click "Go."
If it worked, all of your friends-locked, filtered, and private LiveJournal posts will now be "Private" WordPress posts. - Use a variation on the same method to fix your post titles. Import your XML file into Excel or Access, sort by the title column, and export only those titles that you want to replace (they're probably numbers, but make sure not to include actual numeric post titles, like "20 Things I Hate About Buffy the Vampire Slayer").
Once you have a list of titles to replace, use a variation on the find/replace method detailed above to generate a query like:
UPDATE wp_posts SET post_title='(no subject)' WHERE post_title = '27';
(Where "27" is one of the post subjects you're trying to replace. Also, you can replace (no subject) with whatever you want your untitled posts to be called.) - I haven't figured out a way to import music or moods, because they weren't important enough for me to bother. I'm sure it's possible, though.
Yay! Your journal is imported! But it's got some flaws: entries without subjects now display numbers, and you lost your privacy settings and tags.
Step Four: Customize WordPress to Get More Features
Now that your blog looks cool, you may want to think about functionality. It's easy to add new features to WordPress by installing plugins. Most of them are so easy that you simply download the plugin file, upload it to "wp-content/plugins," and turn it on in your admin panel under "Plugins." Some plugins add additional configuration options to your admin menu, which make it simple to set your preferred options. A few plugins also require you to edit code, but most aren't so complicated.
Here are the Plugins I'm using:
- Userpics: Post Avatar. It's very easy; just save all your LJ icons (use the “Download Them All” Firefox plugin) then upload them to a directory on your server. (You do have to rename them by keyword if you want to keep the keywords, though.)
- Moods: Cricket Moods. Now it's super easy to have multiple mood themes and to create your own moods. (Note: if you use this to duplicate your LJ mood theme, edit the HTML in the moods display plugin so that the images don’t appear on your post page along with the mood checkboxes. ~140 mood icons really slows down the page!)
- Duplicate "lj-cut" functionality: Hide or Cut Post Text.
- Crossposting: you can crosspost your WordPress entries to your LiveJournal with LiveJournal Crossposter. It allows you to create, edit, and delete posts in WordPress, with the changes instantly reflected on LiveJournal. It doesn’t match up moods or icons, but it gets everything else, and matches WordPress categories to LiveJournal tags.
You can also use it to cross-post to any LiveJournal clone site, like InsaneJournal or Journalfen.
You can also use LiveJournal Crossposter Plus, which integrates with Hide or Cut Post Text to convert your WordPress cuts to lj-cuts.
I took it a step further, because I want to crosspost to both InsaneJournal and LiveJournal. So I made InsaneJournal Crossposter. Install it and LiveJournal Crossposter and you'll be able to post to all three journals simultaneously, with edits and deletions reflected everywhere. Plus, you can have different settings for each journal site; for example, I'm allowing comments on my InsaneJournal posts but not my LiveJournal posts.
I also made InsaneJournal Crossposter Plus so that WordPress cut tags will work on InsaneJournal.
My recommendation: install LiveJournal Crossposter Plus and InsaneJournal Crossposter Plus. (You could also use each of them for other journaling services; swap LiveJournal for Journalfen, for example. Or make a third plugin to crosspost to another service.) - Threaded Comments: Wordpress Thread Comment. You'll have to fix some of the weird translation issues, but this is the best threaded comments plugin I found. It worked nicely on every browser I tested it on, and it automatically emails people when someone replies to their comment. Plus you can format the comment display and the reply emails easily. (If you know PHP, you'll probably want to edit it to use nl2br to get line breaks in the emailed comments.)
- Userpics for Commenters: I wrote my own plugin for this, which is basically a mix of EasyGravatars and LJ and Gravatar.
- Comment Preview: Ajax Comment Preview. I chose this one because it worked with the threaded comments plugin I'm using. (I had to give it a higher priority than the threaded comment plugin to get the preview button to show up in the right place.)
- Display “lj user” and “lj comm” tags correctly: LJ User Ex.
- Better Tag Management: SimpleTags, as mentioned above.
- Image Gallery: NextGen Gallery. It's easier than LJ's Scrapbook and does much more. It's a piece of cake to put galleries or slideshows directly into your posts, and it's cool to be able to sort your images and galleries via the drag-and-drop method. You don't realize how behind the times LiveJournal is until you use something like this. (And unlike, say, Flickr, there's no limit to the number of galleries and images).
- Organize Your Sidebar: WordPress already has cool drag-and-drop widgets to organize your sidebar. You can also sort your blogroll easier with My Link Order, which enables drag-and-drop sorting for blogroll categories and links.
- Statistics: WordPress.com Stats. It's awesome; you can see how many people are reading your blog, how they got there, which posts they read, and which links they clicked.
- Better Feed Management: You can format your feed and see how many people are reading it with FeedBurner. They've got a WordPress plugin here. I also installed BetterFeed to put a custom footer on my feed posts.
- Friendslocking: This is the one thing WordPress can't do as well as LiveJournal. The best solution I’ve come up with is to post friendslocked entries as “Private” and to use the Role Manager plugin to create a group called “Friends” which has access to private posts.
There is no way to handle custom filters, though, and there’s a huge flaw which is that anyone can see when there are recent comments on private posts, so anyone looking at the “recent comments” section will know that there was a private post, what it was titled, and who commented on it, though they won’t be able to get to the actual post or read the comments. (I disabled recent comments from the sidebar, but it’s still visible in the dashboard.) - Open ID: There are a bunch of plugins out there, but I haven't been able to get any of them working in conjunction with threaded comments (yet).
My plugin first looks for a userpic based on whether the person has entered their website URL as a LiveJournal, InsaneJournal, or Journalfen address. If they haven't, it looks for a Gravatar. If they have neither, it displays a one pixel transparent gif. It's set to cache new versions of user avatars each week. You need to create a folder called wp-content/uploads/avatars and give the server permission to write to it, then enable the plugin and enjoy.
Download it here.
Other Guides
There are many other guides to moving from LiveJournal to WordPress. I wrote my own because most of the existing guides are outdated, but they were definitely very helpful!
- smuffster: LiveJournal to WordPress
- infotrope.net: Weaning yourself off LJ
- lj2wordpress LiveJournal Community
- noljads wiki: LJ_to_WordPress
- inmostlight.org: Migrating from Livejournal to Wordpress
Updates Since Original Posting
Since I posted this guide, I've continued to customize my blog:
- I figured out how to import comments from LiveJournal with threading preserved.
- How to crosspost moods and avatars.
- How to duplicate custom friends groups and how to crosspost WordPress tags (instead of categories) to LJ/IJ/JF.
- Crosspost to Journalfen in addition to LiveJournal and InsaneJournal. Just take InsaneJournal Crossposter and find/replace the following: "insanejournal.com" -> "journalfen.net", "InsaneJournal" -> "JournalFen", and "ij" -> "jf", then install it as a new plugin.
- Display <lj-cut> tags correctly, and refer to LiveJournal, InsaneJournal, and Journalfen users and communities in WordPress posts and comments using "lj user", "ij user", "jf user" and "lj comm", "ij comm", and "jf comm" tags.
That's it! If you followed this guide, I would love to hear your feedback. Please comment below.
Current Mood:
accomplished &
accomplished


Originally published at rusty-halo.com. You can comment here or there.