Experience importing users and topics from CSV files?

I have a few (82) users and (133) posts I’d like to bring over from an abortive attempt on a former platform. Tiny, but just enough to make copy & paste onerous. I’m tentatively hoping to try the CSV importer script. It would be my first time working with a Ruby script.

I’ve prepared CSV files per discourse/script/import_scripts/csv_importer.rb at main · discourse/discourse · GitHub

But unless I’m missing something, the CSV import script doesn’t seem complete. I see no provision in the CSV requirements or the script to associate posts with parent topics. Not sure what this would end up looking like.

I’d also like the original post dates preserved, but there’s no field here for that.

The Zendesk importer does deal with “topic_id” and “created_at” fields. I don’t know if the Zendesk importer would be a better bet, or if it would bomb out on fields my CSV data lacks. (I’m not coming from Zendesk.)

Wondering if anyone has experience with the CSV importer as-is, or perhaps has modified it to add functionality.

I used the CSV importer before it was incorporated into core (and sponsored its development by @pfaffman).

It seemed to preserve posts in topics just fine, as well as the original post dates. Why not give it a go on a staging instance (or simply after a backup) and see what happens?

If there are issues, it would be good to get the script fixed up - but I suspect it will do the job for you just fine.

1 Like