Migrare una mailing list su Discourse (mbox, Listserv, Google Groups, ecc)

Well, that’s a massive bummer!

I thought Google hadn’t touched it since February 2015, but I stand corrected.

Looks like there was a complete redesign in 2020 and a logo touch-up in 2021.

I am thinking of using the APIs of GMAIL and Discourse and convert mail thread to discourse post. I have gone through the google apis and was able to get the emails but have a few questions about them.

  1. Mail can be downloaded in raw format which is the base64 encoded value of “Original message” of mail. Is that the same as mbox format or is it different?
  2. Is there any sample example of how to add posts and attachments to discourse through API?

Interesting. Is it possible to use the Gmail API to access emails from Google Groups or do you simply have a Gmail account that has all the emails that were sent to the group?

I suggest you save all message into individual *.eml files. You will need to decode the message before saving if the whole message (including the email headers) is base64 encoded. Afterwards follow the steps from Migrate a mailing list to Discourse (mbox, Listserv, Google Groups, etc) (minus the Google Groups steps). The import script will take care of posts, attachments and a lot more.

1 Mi Piace

I am a member of the group so I am able to pull the mails using my email. The entire email message including headers will be part of the encoded string.

Will try your approach for import into discourse at least for a thread.

1 Mi Piace

Well, in that case you might not even need the Gmail API. Connecting an email client like Thunderbird to your Gmail account and exporting individual emails or an mbox file should be enough…

Now I’d really like to know how this works. I was under the impression that Google Groups doesn’t support NNTP.

1 Mi Piace

It’s not NNTP but Rest API.

3 Mi Piace

My mailbox size is more than 200GB and to get specific group-related emails I might need to download all these mails using thunderbird also thunderbird is not showing the google groups all mails are under Inbox only. It is also downloading only 200 emails each time. So, I am not sure how long it could take to get mails etc.

Is there any alternative way to just get a google group data and export it to mbox?

Hi Gerhard Schlager,

We are trying to migrate our google groups to Discourse we followed all the above steps as per the document but it only creates the category in Discourse and not importing the data. Would really appreciate if you can respond on this one quickly.

The only way that we knew about doesn’t work anymore. If you know any way to get the data, then you should do that. If you know a way to get it, you should probably start getting it asap before that method too goes away.

If it’s in your mailbox then it might be possible to use that Gmail api to pull it down. It’ll be tricky though, as a developer would need access to a mailbox with google group data in it to write the code.

Unless an enterprise customer who requires it, I doubt that cdck (aka discourse.org) will be writing that code any time soon. You can ask in marketplace. I likely wouldn’t consider it for under $2000 and, given the frustration that I have had with the Google groups import script on the past, would likely require $5000. Or course, someone else may have better skills or more patience.

One approach that may work is using Integromat to write a conversion assuming google groups and discourse apps are available. Or using the http calls to call the rest APIs on their own.

Integromat is an integration data migration system. It’s very powerful and can do a lot with little to no coding.

Ho provato Google Takeout rendendomi proprietario del nostro gruppo Google Workspace e sono riuscito a scaricare le conversazioni del gruppo Google. Sto ancora lavorando all’importazione.

Un paio di svantaggi di questo approccio.

  1. È necessario scaricare nuovamente tutti i dati se è necessario eseguire un aggiornamento incrementale.
  2. Non è possibile scaricare dati selettivi del gruppo, invece verranno scaricati i dati di tutti i gruppi per i quali l’utente dispone delle autorizzazioni di proprietario o responsabile.
  3. È necessario collaborare con l’amministratore di Google Workspace per abilitare il takeout poiché per impostazione predefinita è disabilitato.
3 Mi Piace

Ciao @Anjana_Raghavendra_P - sei riuscito a fare un’importazione semplice usando questo approccio?

Grazie mille!

Sì, sono in grado di scaricare il file mbox da Takeout e importarlo seguendo i passaggi menzionati nel post originale.

Successivamente, poiché utilizziamo il servizio PAAS di Discourse, abbiamo fornito il file al team tecnico di Discourse che è stato in grado di importare il contenuto nella piattaforma Discourse.

2 Mi Piace

Sono felice di sentirlo, grazie!

Ho riscontrato il problema di @sturdy2 quando in settings.yml, ho modificato la prima riga data_dir: /shared/import/data, dal suo valore predefinito.

Messaggio da portare a casa: non modificarlo in quanto si riferisce al percorso all’interno del docker di importazione, non sulla macchina principale.

Ho una domanda sul riavvio di un’importazione?

Non sono uno sviluppatore, ma sono riuscito a importare con successo due file mbox provenienti da un sistema chiamato Topicbox Group Email. Ho eseguito la mia importazione di prova in un’istanza temporanea di Discourse che ho configurato su Digital Ocean. E sono stato in grado di importare i miei due file mbox di esempio in categorie esistenti che avevo già creato in Discourse, grazie alle note sull’impostazione del campo personalizzato della categoria category.custom_fields["import_id"] = "mydir" di cui sopra.

Evvai! Ma se voglio importare altri file mbox, devo eseguire tutti i comandi menzionati nella FAQ 2.2, che indica che “eliminerà tutto”?

2 Mi Piace

Sono riuscito a impostare correttamente il mio “import_id” per due diverse categorie come importazione di test iniziale. Ha funzionato! I miei due file mbox sono stati importati nelle categorie esistenti che ho specificato.

Ho 18 categorie diverse con cui devo farlo alla fine. Non so nulla di Ruby. Posso creare un file che imposti il nome della directory per ciascuna delle mie diverse categorie in modo da non dover inserire manualmente ogni riga nell’interfaccia a riga di comando di Ruby?

2 Mi Piace

Sì. Cerca su Google “ruby for each”. E crea un array con alcune delle categorie.

1 Mi Piace

No, non devi. L’importatore supporta importazioni incrementali. Importa solo nuovi dati alla prossima esecuzione. Per favore, non eseguire i comandi menzionati in 2.2 a meno che tu non voglia ricominciare da capo.

Purtroppo al momento non è possibile. Devi assegnare a ciascuna categoria l’import_id se vuoi importare in categorie esistenti.

2 Mi Piace

Grazie @gerhard per tutto il tuo incredibile lavoro! Non sono uno sviluppatore, ma sono stato in grado di completare una migrazione da un sistema listserv chiamato Topicbox. Sono riuscito a ottenere file mbox da Topicbox per importarli in Discourse. Durante i miei tentativi ed errori, ho documentato tutto in un post del blog. Quindi, se va bene? Volevo incollare un link a quel post del blog per tutti gli altri utenti Topicbox che desiderano convertire a Discourse.

4 Mi Piace