أنا في منتصف عملية الترحيل من Kunena، وقد نجحت (تقريبًا) في تشغيل ترحيل تجريبي، ولكن مع تفكيري في مشكلة الروابط الدائمة، ومشكلة الروابط الداخلية أيضًا، أتساءل…
هل سيكون من الصعب أن يقوم Discourse بإنشاء منشورات جديدة مع الاحتفاظ بمعرفات المنشورات القديمة التي تم تعيينها أصلاً من قبل Kunena؟ هناك مزايا واضحة لهذا النهج.
أعتقد أن هذا سيتضمن:
بعض التعديلات على سكريبت الاستيراد. هل يمكن لأحد تقدير مدى “عمق” هذا التغيير؟ هل يتم تعيين معرف المنشور في عمق كبير من كود Discourse، أم في مكان ما في سكريبت الاستيراد الأساسي؟
طريقة ما لمنع Discourse من تعيين معرفات منشورات مستخدمة مسبقًا للمنشورات الجديدة في المستقبل. هل هناك مكان يمكننا من خلاله تكوين Discourse ليبدأ في تعيين معرفات المنشورات من 100,000 فصاعدًا، على سبيل المثال؟
هل يمكن أن تكون معرفات المنشورات غير رقمية؟ إذا كان الأمر كذلك، فقد فكّرتُ في أن يكون “k12345” (للأشياء القادمة من Kunena) حلاً وسطًا جيدًا. سأحتفظ بطريقة للإشارة إلى معرفات المنشورات القديمة، لكنها لن تتعارض مع معرفات المنشورات الجديدة التي يعينها Discourse.
The import script saves the import id in a post custom field. You can use it to create permalinks. Several importers do that. You can look at others for examples.
Thanks Jay, I know that, and I use that to go from old ids to new ids.
But it would be more practical to simply use the same number and avoid that de-referencing. I am doing parts of my import with SQL and it complicates queries.
Also, the permalinks table can get quite huge. A regexp redirect is better, and easy if the id is constant.
I had heard about these regexp operations but I was thinking they required post ids to match so a simple find-and-replace could take me from the old post id to the new one.
Or is the mechanism more intelligent and it does a lookup on the post custom field to translate ids?
Yes. You still need to have the post (or topic or category) ID in a permalink.
Your solution might work with a plugin that you would have to continually maintain, but it’ll be really hard, and the recommended way works and has been used dozens of times, including several with millions of posts, and that’s just me.
The approach (without keeping a plug in all the time) could be:
Disable automatic serial numbers for topics
Import everything with the old ids
Re-enable serials, starting at a number larger than the MAX currently used
But ok, I get the point - it’s easier with the permalinks feature. I have found many posts with specific questions about this, mostly people trying to get their regexps right, but I haven’t found any page documenting the actual mechanism in general… is there such a page?
Can anybody point to any Documentation on how to use the permalinks feature? Even if it’s minimal docs. I don’t mind helping to write a more extended documentation once I understand how this works. Thanks.