Importing JSON: Duplicate Post Detected

So I’m running into a bit of a problem and I’m not sure what the issue is. I’m trying to import multiple posts into my Ghost config, and while it accepts the JSON and starts processing it, it only actually imports the first Post. After the first post it returns an error: ‘Post: Entry was not imported and ignored. Detected duplicated entry.’, despite the fact that all of the Posts in the JSON are unique. I’ve tried it with Post IDs and without post IDs. Also it’s definitely not identifying duplicates in the database, because it will reload the first post even if there’s a duplicate in the DB.

Any help would be greatly appreciated, since otherwise it’s down to manual import of 1000+ posts.

JSON for the Posts section listed here (I’ve redacted the actual HTML from the Mobile Doc because you don’t need that spam.

"posts": [
  {
    "title": "County’s Zero-Base Budget Process Finds Savings for County Taxpayers",
    "status": "published",
    "published_at": 1396915200000,
    "feature_image": "content/images/zerobrect.png",
    "mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[],\"sections\":[[1,\"p\",[[0,[],0,\"HTML REDACTED\"]]]]}"
  },
  {
    "title": "Yoga Classes on the Lawn at Rippon Lodge",
    "status": "published",
    "published_at": 1433203200000,
    "feature_image": "content/images/yoga%20at%20rippon%20rect.jpg",
    "mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[],\"sections\":[[1,\"p\",[[0,[],0,\"HTML REDACTED\"]]]]}"
  }
],

Ghost removes only duplicate posts within the file to import.
Based on the slug.

Related issue: No importer duplicate detection for posts · Issue #8717 · TryGhost/Ghost · GitHub

Yeah, through trial and error I discovered that while the slug is theoretically optional if you’re importing multiple posts it requires a slug on each post. I do wish the documentation made that clearer.

Christian R. Williams

Web Developer

We are working on improving our docs & workflows :slightly_smiling_face:Thanks for feedback!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.