Wordpress Importer (customized for LFA project)
Go to file
Marc Remolt ddb65040a7 Refactoring of specs
* split the one large spec file in multiple small, one for each model
* helper for getting dump object in tests
2011-06-05 13:09:06 +02:00
lib Started on cms page import 2011-06-03 18:50:27 +02:00
spec Refactoring of specs 2011-06-05 13:09:06 +02:00
.gitignore Initial commit 2011-06-01 20:23:29 +02:00
.rspec Conversion in a gem finished 2011-06-02 14:41:31 +02:00
Gemfile Conversion in a gem finished 2011-06-02 14:41:31 +02:00
Gemfile.lock Preparing first release (0.1.0) 2011-06-03 11:47:27 +02:00
MIT-LICENSE Initial commit 2011-06-01 20:23:29 +02:00
Rakefile project setup 2011-06-01 21:07:20 +02:00
README.rdoc Added zsh hint to doc 2011-06-03 16:20:59 +02:00
refinerycms-wordpress-import.gemspec Preparing first release (0.1.0) 2011-06-03 11:47:27 +02:00

= Refinerycms-wordpress-import

This litte project is an importer for WordPress XML dumps into refinerycms(-blog). 

So far, only blog-relevant data gets imported, I'm working on the cms pages part. 

You can find the source code on github: https://github.com/mremolt/refinerycms-wordpress-import

== Prerequisites

As refinerycms-wordpress-import is an addon for RefineryCMS, is shares the prerequisites with it.
So you'll first need a running installation of refinerycms and refinerycms-blog. Make sure
the site is running, all migrations are run and you created the first refinery user. 

== Installation

Just add the gem to your projects Gemfile:

  gem 'refinerycms-wordpress-import'

Or if you want to stay on the bleeding edge: 

  gem 'refinerycms-wordpress-import', :git => 'git://github.com/mremolt/refinerycms-wordpress-import.git'

and run

  bundle

== Usage

Importing the XML dump is done via 3 rake tasks:

  rake wordpress:reset_blog 

This one basically deletes all data from blog relevant tables (taggings, tags, blog_comments, 
blog_categories, blog_posts, blog_categories_blog_posts). 
Use this one first, if you want a clean import of your old blog. 

  rake wordpress:import_blog[file_name] 

This one does all the heavy work of parsing the dump and importing the data into refinery tables. 
The parameter is the path to the dump file. Got a report from a Mac user, that the ~
didn't work in the path. I'll have a look at it, but till then, don't use it please. 

If you don't want to import draft posts, you can set the ENV variable ONLY_PUBLISHED to true:


  rake wordpress:import_blog[file_name] ONLY_PUBLISHED=true

The task will then skip all posts that are not published.

  rake wordpress:reset_and_import_blog[file_name]

This one combines the two previous tasks. 

One more hint for users of zsh (like myself): 

The square brackets following the rake task need to be escaped on zsh, as they have a 
special meaning there. So the syntax is:

  rake wordpress:reset_and_import_blog\[file_name\]

Ugly, but it works. This is the case for all rake tasks by the way, not just mine. 

== Feedback

This is still a very new gem. It manages to import my own blog and a standard WordPress 3.1 dump with some sample posts. 
The first feedback is quite good, so it seems, the gem doesn't eat the machines it is installed on. 

If you want to help make it even more stable, please throw your own WP dumps against it 
and see what happens. If you encounter any bugs, please file a bug report here on github.
A sample dump that breaks this gem would be really helpful in that case. 

For extra karma, fork it, fix it yourself and send a pull request! ;-)