Migrer un forum phpBB3 vers Discourse

I can at least say that it not only happens for those cases where older posts link to newer ones.

I got one example where I first found the issue.

Original Post ID: 842948 links to Page 22 of a thread that already existed and at least the start post (&start=220) has an ID lower than the linking post (842880)

After import this original post (which was posted only days before the dump was created) links to a 7 year old thread where the first post has an original ID of 1353.

I can’t seem to find any hints on why this happens, any similarities in numbers in any way… The original link was just a plain posted URL which was auto linked by phpBB. Those links in general don’t cause any issues - they work in several other places.

Generally I don’t expect the import to go well immediately. I’m really happy to how it went so far but I assume this issue might be one of the hardest to fix, especially because I don’t have any clue of setting up a dev/debug environment with Discourse yet. Might need to dig into that soon.

3 « J'aime »

Hi,
From what I remember, the phpbb importer was by default filling the Discourse user full name by guessing from the user email address. Am I right and is it still the case? I can’t find anything about this in the importer files…

This is something I wouldn’t want to happen in the next forum I may import.

Also, another question.

On the current phpbb forum, there are custom user fields (like users facebook or instagram urls). I would like to import this in Discourse custom fields. I guess I’ll do something like first installing and configuring Discourse by adding these custom user field, then importing the phpbb data from my custom import script?

1 « J'aime »

That’s not happening anymore.

That sounds like a good plan.

6 « J'aime »

Is there a reliable way to estimate the monthly volume of emails that Discourse will send to users after a migration from phpbb? New user registrations, mentions and replies, weekly digests and so on… Phpbb sends very few emails by default and I think we’ll have to change the current email provider.
I don’t currently have much stats from the actual phpbb. It exists since 2013, with 200000 messages and 5500 members. New members register everyday.

1 « J'aime »

How many posts per day?

1 « J'aime »

I dont know yet. I have currently nothing but the public stats. Maybe 20.

1 « J'aime »

With only 20 posts per day I think you’d probably be looking at 3000 emails a month, at most, well within the free Mailgun plan.

However seeing as you’re migrating with lots of users I’d recommend you turn off the digest emails for everyone who hasn’t been to your forum within the last month or two (they can always turn it on themselves if they want). You can do that with a query in the Rails console, but it’s been a year since I did it for mine, so I don’t remember the exact code sorry.

That should actually be something the import script could do for you IMO, ideally with a setting for the time since last visit to enable digest emails.

4 « J'aime »

I disagree. That’s not something an import script should do, but there’s a site setting for this: suppress digest email after days

4 « J'aime »

Indeed :slight_smile: After my first phpbb import on my current forum, I had to decrease the default value; my email provider automatically blocked the used address because of all the digest emails sent. It was flagged as spam.

1 « J'aime »

It’s not quite the same thing. There’s a difference IMO between sending digest emails to someone for X months since their last visit when they signed up for it - just because they don’t visit the forum doesn’t mean they’re not reading the digest emails - and sending digest emails to a user who never signed up for them because they registered in the previous forum, which may not even be legal in some jurisdictions! You could simply turn off digests for every migrated user, and they can turn then on for themselves, or you could do as I did and turn them off for everyone except those who visited within the last month and who therefore would have seen the “we’re going to migrate the forum soon” announcement. I think that’s a fair middle ground.

It’s also practical - our phpBB forum had gained thousands of spammer accounts within the last year and sending the digest to them four times a month would have used all our free mailgun allowance and then started costing a lot. Reducing “clean up inactive users after days” eventually cleaned them up.

5 « J'aime »

Not sure if this belongs here or in a separate topic. But it’s about migrating from phpbb 3 so here I am.

I have successfully migrated to discourse with 1 database. However I have 3 different, separate communities (3 different languages, 3 different phpbb installs), which ideally I would all have merged into one big happy discourse forum.

My question is: how would I go about doing this? What do I need to change in the import script / phpbb 3 database / anywhere else?
There are a few users who have accounts on both forums, (a few maybe even on all 3), but there is no single sign on so they have a different account on each forum with the same username. They are all different installs and different databases.

It would be awesome if this was feasible!

Thank you in advance for any help!

1 « J'aime »

It won’t work out of the box, because the import script stores the original IDs in the Discourse database and it won’t import data from an additional forum if it finds a record with the same ID. However, I can think of two ways of solving this:

  1. Hard: You need to edit the import script in various places and add a prefix for each forum to the import_id custom fields stored for posts, topics, categories and users.

  2. Easy, but you will lose the ability for incremental imports: Delete the custom fields after each import.

    TopicCustomField.where(name: 'import_id').delete_all
    PostCustomField.where(name: 'import_id').delete_all
    CategoryCustomField.where(name: 'import_id').delete_all
    UserCustomField.where(name: 'import_id').delete_all
    

Solution 2 is untested, but in theory it should work. Create a backup before you give it a try.

7 « J'aime »

Après les premiers tests avant les fêtes de fin d’année, nous reprenons le cours de notre projet de migration. L’un des problèmes les plus importants reste la réécriture échouée des liens, et je réfléchis à la meilleure façon de gérer cela.

@gerhard, mes connaissances en programmation sont très basiques et je n’ai aucune connaissance de Rails en général ni de la structure détaillée de Discourse. Veuillez donc m’excuser pour ma question : Y aurait-il une possibilité de gérer le cas où l’importateur ne trouve pas le message importé correspondant à l’ID donné dans le lien, et au lieu de le remplacer par un lien erroné, d’ajouter un texte informant l’utilisateur ou l’administrateur, rendant ainsi ces liens problématiques repérables après l’importation ?

Ma principale préoccupation quant au fonctionnement actuel est que ces liens semblent simplement avoir été remplacés avec succès, sans qu’il soit possible de les identifier et de les corriger manuellement après l’importation.

Merci pour toute aide que vous pourriez m’apporter, elle est vraiment appréciée.

1 « J'aime »

Une façon de procéder consiste à réécrire le script afin qu’il ne remplace ces liens qu’après l’importation de tous les posts. Si vous avez besoin d’aide et disposez d’un budget, vous pouvez me contacter ou poster dans Marketplace.

4 « J'aime »

Malheureusement, ce projet dispose d’un budget restreint et je suppose que ce problème n’est pas assez important pour justifier une dépense, mais il est tout de même rassurant de savoir que vous seriez disponible pour cela.

Une autre question : j’ai remarqué que le BBCode semble être traité différemment lors de l’importation. Par exemple, [size] est simplement laissé tel quel, tandis que [color] semble être complètement supprimé. Je souhaitais réutiliser la couleur et j’ai découvert qu’il existe un plugin Discourse pour cela, mais j’ai ensuite remarqué qu’il semble être supprimé à l’importation. Le message initial indique que les BBCodes peuvent être importés, mais je n’ai trouvé aucun paramètre permettant de contrôler lesquels sont importés ou non.

Si c’est possible, je préférerais supprimer les balises [size] et conserver [color]. Y a-t-il quelque chose que j’aurais manqué concernant la façon dont cela est géré et comment cela pourrait éventuellement être modifié ?

1 « J'aime »

Je viens de découvrir que les sujets ayant été purgés sur mon forum phpBB, et que je croyais disparus, ont en quelque sorte été transférés vers Discourse.

Comment est-ce possible ?

1 « J'aime »

J’essaie de faire cela, mais je suis perdu(e) face aux instructions : de quel fichier de paramètres parlez-vous ? Et quand dois-je le faire ? Avant ou après l’importation ?
Merci d’avance !

edit : donc je pense que vous parlez des fichiers de paramètres des émojis dans le panneau d’administration (CP) ? Y a-t-il un moyen de le faire en important un fichier texte ou autre ? J’ai environ 100 smileys personnalisés et je préférerais pouvoir copier ce mappage dans Discourse. Est-ce possible ? (Si je pouvais copier le fichier smily.pak de phpBB quelque part dans les paramètres de Discourse ?)

1 « J'aime »

Vous avez bien vu le fichier de paramètres de l’importateur, hein ? :wink:

3 « J'aime »

Je suppose que phpBB gère les sujets élagués différemment des sujets supprimés normalement. Dans ce cas, ce n’est pas pris en charge pour le moment. Vous devrez découvrir comment phpBB marque les sujets élagués comme supprimés et modifier le script d’importation.

3 « J'aime »

Ah oui, bien sûr ! Cela fait trop longtemps que je n’ai pas fait la première conversion. J’avais totalement oublié ça, merci !

Concernant les sujets élagués, oui, je pensais que c’était quelque chose comme ça. Ce n’est pas un gros problème pour mon forum, mais c’était surprenant et peut-être une information utile pour les autres que cela puisse arriver.

1 « J'aime »