| CARVIEW |
Blog Migrations
Most methods listed on this page require read access to the database to generate posts from your old system. Each method generates .markdown posts in the _posts directory based on the entries in the DB. Please make sure you take a look at the generated posts to see that information has been transferred over properly. Also, the majority of the import scripts do not check for published or private posts, so please look over what Jekyll has created for you.
*Note: There’s been an issue opened to improve this process. If you have ideas or comments, chime in!
How to use
These converters are part of the Jekyll gem. There’s probably a better way to do this… but, here’s what I did.
- Add an _import directory to your project
- Open a terminal
- Install open_gem (unless you already have it)
- Type gem open jekyll
- Open lib/jekyll/converters/
- Copy csv.rb to _import
- Copy your converter of choice (mephisto.rb, etc.) to _import
- Navigate to the _import directory via terminal
- Run the respective commands below.
If you need to tweak something in the import process, just edit your local copies of the converter code.
WordPress
$ export DB=my_wpdb
$ export USER=dbuser
$ export PASS=dbpass
$ ruby -r './lib/jekyll/converters/wordpress' -e 'Jekyll::WordPress.process( "#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
Movable Type
$ export DB=my_mtdb
$ export USER=dbuser
$ export PASS=dbpass
$ ruby -r './lib/jekyll/converters/mt' -e 'Jekyll::MT.process( \ “#{ENV[”DB"]}", “#{ENV[”USER"]}", “#{ENV[”PASS"]}")'
Typo 4+
$ export DB=my_typo_db
$ export USER=dbuser
$ export PASS=dbpass
$ ruby -r './lib/jekyll/converters/typo' -e 'Jekyll::Typo.process( \ “#{ENV[”DB"]}", “#{ENV[”USER"]}", “#{ENV[”PASS"]}")'
This code also has only been tested with Typo version 4+.
TextPattern
$ ruby -r './lib/jekyll/converters/textpattern' -e 'Jekyll::TextPattern.process( \ “database_name”, “username”, “password”, “hostname”)'
The hostname defaults to localhost, all other variables are needed. You may need to adjust the code used to filter entries. Left alone, it will attempt to pull all entries that are live or sticky.
Mephisto
$ export DB=my_wpdb
$ export USER=dbuser
$ export PASS=dbpass
$ ruby -r './lib/jekyll/converters/mephisto' -e 'Jekyll::Mephisto.process( "#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
Need to import Mephisto comments too? Here’s some nice code to get you started.
