Skip to content

Navigation Menu

Sign in
Sign up
Hannah Wolfe edited this page Aug 20, 2014 · 14 revisions

Ghost imports from existing blogs by having them export a JSON file and then reading that in.

Existing Plugins to Automate this:

Official

Non-official

Importing the JSON

Once you've generated the JSON go to /ghost/debug on your blog to access the import form.

Rolling your own.

If no export tools exist for your current blogging system you'll need to create one that generates a JSON file that resembles the following. Please note that it should have no linebreaks, comments, or indentation in the final format. Those are only included here for readability and explanatory purposes.

{
 "meta":{
 // epoch time in milliseconds
 "exported_on": 1388805572000,
 // Data version, current is 003
 "version": "003"
 },
 "data":{
 "posts": [
 {
 "id":5,
 "title": "my blog post title",
 "slug": "my-blog-post-title",
 "markdown": "the *markdown* formatted post body",
 "html": "the <i>html</i> formatted post body",
 "image": null,
 "featured": 0, // boolean indicating featured status
 "page": 0, // boolean indicating if this is a page or post
 "status": "published", // or draft
 "language": "en_US",
 "meta_title": null,
 "meta_description":null,
 "author_id": 1, // the first user created has an id of 1
 "created_at": 1283780649000, // epoch time in millis
 "created_by": 1, // the first user created has an id of 1
 "updated_at": 1286958624000, // epoch time in millis
 "updated_by": 1, // the first user created has an id of 1
 "published_at": 1283780649000, // epoch time in millis
 "published_by": 1 // the first user created has an id of 1
 }
 ],
 "tags": [
 {
 "id": 3,
 "name": "Colorado Ho!",
 "slug": "colorado-ho",
 "description": ""
 },
 {
 "id": 4,
 "name": "blue",
 "slug": "blue",
 "description": ""
 }
 ],
 "posts_tags": [
 {"tag_id":3, "post_id":5},
 {"tag_id":3, "post_id":2},
 {"tag_id":4, "post_id":24}
 ],
 "users": [
 {
 "id": 2,
 "name": "user's name",
 "slug": "users-name",
 "email": "user@example.com",
 "image": null,
 "cover": null,
 "bio": null,
 "website": null,
 "location": null,
 "accessibility": null,
 "status": "active",
 "language": "en_US",
 "meta_title": null,
 "meta_description": null,
 "last_login": null,
 "created_at": 1283780649000, // epoch time in millis
 "created_by": 1, // the first user created has an id of 1
 "updated_at": 1286958624000, // epoch time in millis
 "updated_by": 1 // the first user created has an id of 1
 }
 ]
 }
}

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /