Easiest way to export a single topic?

Hello,

We are trying to export a single topic from one Discourse instance to either local storage or preferably another instance. The admins on the original instance support the move, but do not necessarily want to spend a lot of time working on making the move, and so we are looking for whatever solutions are available that are relatively quick and painless.

Thus far, we are considering two options:

While the first link is certainly the most direct way to achieve our end goal, we are not sure our admins will be on board with having to do what seems like a sizable chunk of work on their end to support the move, and so are also considering @pfaffman’s Discourse Downloader.

However, if one of these options is clearly better given our needs and constraints, we’d really appreciate some insight from others who have done one or the other, or are more familiar with the process than we are. Plus, if there’s any other option we haven’t found that would be better, we would really love to mnow!

Thanks for your time!

2 Likes

The topic/category import/export command line tool boils down to a few commands and five minutes of work, at most.

Did you consider the legal implications of copying users to another instance?

3 Likes

All users are consenting to the move, so I would not expect it to be an issue.

If you think otherwise, please let me know!

1 Like

Do you really mean one topic? Why not copy and paste in the web interface?

Edit: oh yeah. A topic has many posts. Sorry. :frowning_face:

Anyway, now that I understand, I think that I’d use the rake task if you can get your admins to do it. I don’t think it’s that hard.

1 Like

Possible reasons:

  • You want the users, uploads, quotes, likes as well
  • The topic has a zillion posts
2 Likes

Alright so

The admins said no to both solutions because it would be too much work to do

Their words, not mine, I’m also not a fan

I don’t suppose you know how to get a .json file for not one post but the whole topic without admin perms?

Edit: This might be best as its own topic, as I suppose it’s no longer in line with the title. Still, seems spammy, so I won’t.

1 Like

I don’t think you need to run @pfaffman s solution on the server. You don’t need the admins for it AFAIK.

It requires an API key.

Is this a public forum topic? In that case this should work without API key.

Wow! It does look like I wrote it such that it won’t require an API key if it’s a public topic.

Or maybe not?

I pushed a fix, so you can do a git pull and it should work now with an empty apikeys file. (I think you need to create an empty one, though). It will download a topic to a text file.

I wrote it for off-line analysis of discussions, however, so I’m not sure how useful it’ll be without some work. I think that it should let you download the stuff locally, but won’t be much help (as it is) to move it to another Discourse.

If you want it moved to another Discourse and it’s a public topic, you’ll need to, say, get this tool to something different. If you have a budget you can contact me or post in #marketplace.

2 Likes

To be honest if I was going to spend that much time I’d probably just write something that crawls the topic and manually grabs all of the individual .json files lol

Unfortunately I’m not really able to give the resources to either of those options, so running the downloader may just be the best option I have.

Thanks!

1 Like

That code is a good place to start. It’s downloading the json files and then converting them to other stuff.

2 Likes

Sounds helpful - thanks!

1 Like

Thanks for the Ruby code, @pfaffman!

For those who prefer Python, there is a great start at how to use the API and json files at mcmcclur/ArchiveDiscourse: Code for archiving my Discourse sites.

2 Likes