Hey, ich verlagere eine Menge Inhalte von meiner alten (proprietären) Forum-Software zu einem neuen Discourse-Forum.
Da ich kein Ruby-Entwickler bin, konnte ich die von Discourse bereitgestellten Beispiel-Importskripte nicht wirklich nutzen – das wäre für mich keine gute Lösung. Deshalb rufe ich einfach die API auf, um alle Schritte zu erledigen.
Das Problem ist, dass ich unterwegs auf viele Probleme stoße, hauptsächlich Rate Limiting, aber auch Probleme mit wiederholten Foren und das Einbringen des Nachrichteninhalts durch alle „Realitätschecks" (zum Beispiel: Mindestlänge eines Beitrags, was ich schließlich in den Einstellungen auf ‘1’ geändert habe).
Gibt es eine andere oder bessere Option? Kann ich Daten irgendwie direkt in die Datenbank schreiben oder …?
If you know any programming languages starting with the existing import scripts is the way to go. The bulk import scripts directly modify the sql but they are still written in ruby.
Ok… I’ll look at the scripts… I’m an experienced coder in other languages, just not Ruby/RoR.
…
Ok I’m back from looking at the existing import scripts in github. From what I see, it looks very much like the code I’ve already written to do my importing… lots of loops to get the users, the topic and finally the messages. Special code to deal with attachments (uploading them separately, getting the Discourse internal URL, appending that to the message body).
Are there any special API calls or anything else I’m missing in these scripts that might help me? The issue isn’t that I can’t write my own import script (using the API), my issue is that it seems clunky and I wonder if there is a smoother/more elegant solution. If there are any “tricks” (like special API calls?) in the sample scripts that I can borrow in another language, I’d love to understand.
Heh, yes, we have established that, and we have also established that I don’t know RoR, so investing the time to rewrite one of the existing scripts is not a good solution for me either. If you have any other recommendations that might help me out here I’d (sincerely) love to hear them. Thank you.
The core migration scripts are a great starting place. A month ago I had also never programmed in Ruby before as well.
In fact, a few days ago I wrote a custom PHP script to help with migration (a long decade of PHP years behind me) but decided to rewrite in Ruby and “its a piece of cake” LOL
Now, I am a Ruby fan!
Ruby looked a bit strange to me at first but now its starting to make sense.