URL required in script to import from csv

Hi,

I’m trying to import a custom forum to Discourse, and I’m using the zendesk script, since I need to run the import from csv files.

Unfortunately, the script seems to require an existing url for each category, topic and post. I don’t need this feature, and the script fails to run if I don’t provide those urls.

My questions are :
1 - Can Discourse generate all these urls automatically ?
2 - How should I edit this script to prevent it from requiring old urls ?

Thanks.

Unless the custom forum somehow keeps its data in csv files, or you have zero programming knowledge, I’d recommend that you modify some sql-based importer.

I think vBulletin or vanilla might be good places to start.

But how to modify the existing script is mostly beyond the level of support you’re likely to get here.

1 Like

The SQL is a mess, and it was somehow easier to export the data to a csv.

I was curious about the way Discourse handles the creation of new urls if an import script doesn’t do it.

And yeah, it was certainly too much to ask to rewrite parts of a script from a contributor.

Without looking at the code I can’t quite guess what’s going on. If the urls that you are referring to are the category and topic urls, then yes, they are created automation, but it sounds like the script generates the category, topic, and posts separately, so the left hand doesn’t know what the right hand is doing.

If that’s the case, you’d need to run the category creator, then put the category path in the topic creator, then put those topic paths in the post creator? If you want them all in one category, then you should use just the one url for that.

It’s hard for me to imagine that the sql is more of a mess than the csv, but sometimes I don’t have a very good imagination.

1 Like