Git Product home page Git Product logo

ghost-to-wp's Introduction

NOTE THIS PROJECT HAS BEEN ARCHIVED

There will be no further maintenance or development.

Ghost to Wordpress Blog Migration Tool

Use ghost-to-wp to migrate a Ghost blog to Wordpress.

You will get the full HTML content, author, and tags for all posts and pages, including whether it's a page or a post, published or draft, and featured/sticky or not.

If you use the optional second argument, all image filepaths will also be updated for easy image migration.

Usage

  1. Export your Ghost site data as a JSON file.
  2. Make a copy of your site images stored at the /content/images/ directory, or if hosted by ghost.org, ask for your image archive.
  3. Make sure you have nodejs and npm installed on your machine.
  4. Install:
npm i -g ghost-to-wp
  1. Convert your Ghost export file:
ghost-to-wp EXPORT_FILE [DOMAIN_NAME]

For example:

ghost-to-wp /Users/hugh/backups/example.ghost.2021-04-17-11-17-45.json https://blog.example.com

You should now have a new file called WP_import.xml. Import this file to your WordPress site using the WordPress site importer (Tools - Import - WordPress) - you will be able to map authors to existing users in Wordpress before the post and page import begins, as long as you have created user accounts for your authors ahead of importing.

Arguments

The first argument should be the filepath to your ghost export file, and the optional second argument is the base domain of your blog including the protocol (http/s) but not including a trailing slash. If you are changing your domain this argument should be the new domain.

Images

Migrating images requires the second argument.

WordPress expects image URLs to be absolute, not relative, but Ghost doesn't really mind either way. If you provide the second (domain name) argument this will:

  1. replace any relative image links you may have with absolute URLs
  2. replace any references to __GHOST_URL__ in your image links
  3. update your image directory references from /content/images/ to /wp-content/uploads/.

You can then copy (using FTP, rsync or something else) everything from your Ghost /content/images/ directory to your WordPress /wp-content/uploads/ directory and your images should display.

Ghost doesn't provide a browser-based image export function and WordPress doesn't provide an inbuilt browser-based image import function so you will need to do this manually as per the above.

Caveats & Limitations

  1. Ghost doesn't have 'categories' so this only imports tags. You can use the WordPress Categories to Tags Converter if you want to change some tags to categories once imported.

  2. The image migration tool using the second argument is a simple regex find-and-replace. If you have a lot of posts where you write about /content/images/ filepaths or use that string in a code example, ghost-to-wp will replace that text as well.

License

GPL 3+

ghost-to-wp's People

Contributors

hughrun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ghost-to-wp's Issues

Problems with featured images.

Hi, the tool is working, but I think something has changed in Ghost .json. I noticed that the featured images are not going to the XML, which ends up migrating only the textual part. I know we're almost in 2024, but is there still a possibility of this tool getting a new version? I would really appreciate it! Thanks!!

Trying this on a json with 1900+ entries

Hi!

I'm trying to migrate our blog from Ghost Pro to Wordpress, but for some reason it wont work. The script runs fine, and I get an XML to import to Wordpress. But when importing WP only takes 597 posts and the script reports 1902 entries.

I'm not sure what the error is, Im thinking it might be the size?

Partial import

I created the Ghost Pro json and tried to import. Wordpress imported 16 from 95 posts and then finished. I repeated to check and the same thing. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.