Can't Import Tags With Custom Ghost Migration


#1

Hello everybody,

I’m trying to migrate an old Drupal 6 ( ~640 posts ) blog site to Ghost 2 and I’ve successfully written a custom exporter than pulls the Blog posts from the site and puts the data in a JSON for the ghost import, but I’m having problems getting the tags to tie to the posts. Everything else is working, I’ve got users, posts, and tags creating properly, but I can’t get Ghost to apply the tags to the posts.

Here is a test export:

This is an example of JSON in the format that my exporter generates. I have tested importing this into the latest Ghost 2.14.3 in a completely clean install using the official Docker image.

As far as I understand the post_tags section should apply tag 2 ( Tag Gat ) and tag 3 ( Bat Tab ) to post 28 ( My Post ), but even though the tags are created, and the post is imported, the post does not have either or the tags applied to it.

Any help is greatly appreciated. If I am misunderstanding something that would be great, I just have to update my exporter. :slight_smile:


#2

Hi,

It looks you are pretty close there but you will need posts_tags instead of post_tags. :wink:


#3

Thank you! I can’t believe that I have spent the last four hours trying to figure that out. :man_facepalming: I even had the thought at one point and I must have looked at my own file for reference instead the an actual export on accident.

Thanks again, now I can migrate my site! :tada:


#4

Just an FYI here, we’ve updated our migration docs to try to make how to create a custom import easier and clearer: https://docs.ghost.org/api/migration/

We’ve also started to provide tooling, the first being an HTML -> Mobiledoc converter, which might be handy and with plenty more in the works.


#5

Awesome, that is great! The Mobiledoc section is greatly appreciated. :+1:

BTW the site migration went well. Everything is working and the site looks amazing with the Massively theme. :smile:


closed #6

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