Coding

Something Old and New: Importing WordPress posts into Sitefinity

I can’t take too much credit for this, however, I made enough updates to the library that I felt it warranted a post.

If you’re migrating your blog from WordPress into Sitefinity, I’ve taken an existing tool (major HT to timw255) and modified it. I disabled some features with loading tags/metadata that caused errors. More importantly, I added the ability to have a “default” e-mail address, properly import the full image from the “thumbnail” images that WordPress typically uses, and cleaned up the summary field.

It’s on Github, so as they say, if you don’t like what I did, fork it and improve it yourself! 8^D

You can get the WordPress to Sitefinity tool here.

Continue reading “Something Old and New: Importing WordPress posts into Sitefinity”

Advertisements
Quick Tip
Geekery

Quick Tip: Bulk Edit Post Formats in WordPress

As you may have noticed, I recently merged my photo blog and quote blog here into my main blog. As part of that process, I wanted all of my photos to use the “gallery” post format to take advantage of its display options in the new twenty thirteen theme. When you’re in the main post editor, there’s not way to “bulk edit” post formats. Here’s a “back door” trick on how to get it done. Continue reading “Quick Tip: Bulk Edit Post Formats in WordPress”

Coding

Migrating BlogML to WordPress 3.0

Update (1/18/2013): An amazing developer by the name of Patrick Daly has updated this plugin through GitHub to import tags too. Go grab it here!

Update: My plugin has been approved by WordPress! I’ve updated the documentation and links accordingly.

As part of my migration to WordPress 3.0, I needed to get all of my posts migrated over. My comments were stored via Disqus, and I’m working with them on migrating that data to the new URL slugs.

BlogEngine.Net uses BlogML as their sole export format, which became a little tricky, since there is still no WordPress importer built in to handle this.

As is with most things in life, we are all standing on the shoulders of giants. In this case, Aaron Lerch was my giant and he had created a great BlogML importer, which included all of the necessary XPath information needed to import blog entries.

The only problem is that the plugin was created to work with WordPress 2.6, and the format for importing content has changed since then. The  ‘wp-admin/imports’ folder no longer exists in 3.0, and it could have been earlier than that as well.

An initial peek of the importer code didn’t yield any results to me, but installing the simple RSS importer and examining that code allowed me to see what was going on. With the newer format for importing, you downloaded a plugin, which upon activation registered itself with the import module used in WordPress. All I needed to do was to put this registration wrapper around the existing code, update some documentation, and voila, a working BlogML importer!

Just as my giant has opened the code up, I’m doing the same, for any BlogEngine.Net,  SubText, or other BlogML formatted folks out there that are thinking of migrating to WordPress.

Before importing, you’ll want to go into your BlogML file and look for any file or image references that exist and update them accordingly. For instance, with BlogEngine.Net, it uses a ‘file.axd’ HTTP helper to deliver a lot of its files. You can always update this data after the import. It is up to you.

Using the importer is rather simple:

  1. Log into your WordPress site and go to the ‘Plugins’ section.
  2. Click the “Add New” button and search for the term “blogml”.
  3. Find the ‘blogml-importer’ plugin and install it.
  4. Activate the plugin.
  5. Go to the Tools->Import screen, and select the ‘BlogML’ option.
  6. Follow the directions to complete the process.

As an added bonus (thanks to Aaron), the import process will create a CSV file that maps the old permalinks found in the BlogML file to the new permalinks that WordPress generated. It will also give you the option of mapping posts to a current user, or to create a new user account for them.

I ran this process and had all of my posts migrated over in a few seconds. Granted I only had 65 posts, but it still saved me a lot of time. I’m still doing a bit of image/link cleanup, but that is simple to do.

One other important item to note is that categories and tags may or may not be properly imported. In my case, none of my tags came over, and my categories came over named as GUIDs. Renaming the categories didn’t take long and I’ll simply need to retag my posts. Again, considering the time it would have taken me to renter all of my posts (and I know others have lots more), I’m not too worried about this.

I hope this helps other folks out their with their WordPress migrations. I’m hoping to look through the import code again, and work on getting some of the category/tag issues resolved. I may even try to do some kind of auto-detecting on the image/file links to provide a proper “remap” option like with the user import. Once the plugin is approved in the codex, I’ll update my link to point there.

Enjoy!

If you want to download the plugin go to the direct link here.

UPDATE: If you want a standalone tool that will migrate BlogML to WordPress, check out the Blog Migration Tool I wrote over on CodePlex.