ageitgey / medium_to_ghost

Instantly move all your Medium.com content (formatted posts + images) to an open source Ghost blog!
MIT License
121 stars 13 forks source link

Medium to Ghost 2.0

Feeling locked into Medium.com? Instantly move all your content (formatted posts + images) to an open source Ghost 2.0 blog!

Migrate your data out of Medium to Ghost

This code converts all your Medium.com posts to a Ghost 2.0.x import file. With that, you can import all your content into a Ghost blog (hosted anywhere) in seconds. Your posts keep the same formatting and all your images are migrated over too.

Why?

Medium.com is a nice platform for creating blog posts. I use it and enjoy it.

But you should never feel like your content is locked into someone else's privately-owned platform. This gives you the option to move your content to your own blog if you want to do it. It's also a quick way to back up all your Medium.com content (especially your images which they don't export) in case the site disappears someday.

I hacked this together quickly to move my blog, Machine Learning is Fun! from Medium to a self-hosted Ghost site. Hopefully it's useful to someone else too. More options is always good, right?

Requirements

Installing this program

After you've installed Python 3.6+, you can install this program by opening up a terminal window and running this command:

Mac / Linux

pip3 install medium_to_ghost

Windows

pip install medium_to_ghost

How to use this to export your Medium content

  1. Install Python 3.6+. Lower versions won't work!
  2. Install this program (See "Installing this program")
  3. Go to https://medium.com/me/settings and find Download your information. There's a button to export your data and email it to you.
  4. Wait for the email from Medium and download your zip file. This will give you a file called medium-export.zip
  5. Run python3 -m medium_to_ghost.medium_to_ghost medium-export.zip which will produce medium_export_for_ghost.zip. This new zip file contains all your converted Medium posts and images from your posts. Make sure to put the full path to the zip file if it's not in the current directory. This may take a few minutes if you have lots of images in your posts since they all have to be downloaded.
  6. Go into Ghost 2.0.3+, navigate to /ghost/, click on 'Labs', and choose to import that zip file.
  7. That's it!

What gets moved over

When exporting content from Medium, the following features are supported:

What is lost when moving over

Warnings!