diff --git a/Gemfile.lock b/Gemfile.lock index 82e738e..87cc944 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ./ specs: - refinerycms-wordpress-import (0.2.0) + refinerycms-wordpress-import (0.3.0) bundler (~> 1.0) nokogiri (~> 1.4.4) refinerycms (~> 1.0.0) diff --git a/README.rdoc b/README.rdoc index 54206c3..1c677c3 100644 --- a/README.rdoc +++ b/README.rdoc @@ -4,10 +4,7 @@ This litte project is an importer for WordPress XML dumps into refinerycms(-blog You can find the source code on github: https://github.com/mremolt/refinerycms-wordpress-import -Keep in mind, this gem imports blog posts and pages, NOT the media files, as they are not -part of the XML dump! You have to manually readd them to Refinery. - -The same goes for links to other pages on your site. WordPress exports them just as -Tags. +Keep in mind that links to other pages of your blog are just copied, as WordPress exports them as -Tags. If your site (blog) structure uses new urls, the links WILL break! For example, if you used the popular WP blog url structure "YYYY-MM/slug", be warned that Refinery just uses "blog/slug". So your inner site links will point to the old WP url. @@ -84,6 +81,39 @@ If you want to clean the tables and import in one task: rake wordpress:reset_and_import_pages[file_name] +Finally, if you want to reset and import all data including media (see below): + + rake wordpress:full_import[file_name] + + +== Importing media files + +The WP XML dump contains absolute links to media files linked inside posts, like: + +http://www.mysite.com/wordpress/wp-content/uploads/2011/05/cv.txt + +The dump does NOT contain the files itself! To get them imported, this gem downloads the files +from the given URL and imports them to refinery. So for a working media import the old site with +the media URLs must still be online. + +After importing the files, this gem replaces the old links in pages and blog posts with the +new generated ones. It parses all existing records searching for the right pattern. That +means, you have to import pages and posts FIRST to get the URLs replaced. + +Now to the rake tasks for media import: + + rake wordpress:reset_media + +This task deletes all data from the media tables (images and resources), ensuring a clean import. + + rake wordpress:import_and_replace_media[file_name] + +This task imports all the WordPress media into Refinery. After the import it parses all +pages and blog posts, replacing the legacy links with the current refinery ones. + +If you want to clean the tables and import in one task: + + rake wordpress:reset_import_and_replace_media[file_name] == Usage on ZSH diff --git a/refinerycms-wordpress-import.gemspec b/refinerycms-wordpress-import.gemspec index 7462a0f..e1bac73 100644 --- a/refinerycms-wordpress-import.gemspec +++ b/refinerycms-wordpress-import.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |s| s.name = "refinerycms-wordpress-import" s.summary = "Import WordPress XML dumps into refinerycms(-blog)." s.description = "This gem imports a WordPress XML dump into refinerycms (Page, User) and refinerycms-blog (BlogPost, BlogCategory, Tag, BlogComment)" - s.version = "0.2.0" - s.date = "2011-06-05" + s.version = "0.3.0" + s.date = "2011-06-13" s.authors = ['Marc Remolt'] s.email = 'marc.remolt@googlemail.com'