Migrar una lista de correo a Discourse (mbox, Listserv, Google Groups, etc)

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 me gusta

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 me gusta

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 me gusta

It’s not NNTP but Rest API.

3 Me gusta

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.

He intentado Google Takeout haciéndome propietario de nuestro grupo de Google Workspace y pudiendo descargar las conversaciones del grupo de Google. Todavía estoy trabajando en importarlo.

Un par de inconvenientes con este enfoque.

  1. Necesidad de descargar todos los datos de nuevo si se necesita hacer una actualización incremental.
  2. No es posible descargar datos selectivos del grupo, en su lugar, esto descargará datos de todos los grupos para los que el usuario tenga permisos de propietario o administrador.
  3. Necesidad de trabajar con el administrador de Google Workspace para habilitar la exportación, ya que por defecto está deshabilitada.
3 Me gusta

Hola @Anjana_Raghavendra_P: ¿lograste hacer una importación simple usando este enfoque?

¡Muchas gracias!

Sí, puedo descargar el archivo mbox de Takeout e importarlo siguiendo los pasos mencionados en la publicación original.

Posteriormente, como estamos utilizando el servicio PAAS de Discourse, le proporcionamos el archivo al equipo técnico de Discourse, quienes pudieron importar el contenido a la plataforma de Discourse.

2 Me gusta

Me alegra oír eso. ¡Gracias!

Encontré el problema de @sturdy2 cuando en settings.yml, cambié la primera línea data_dir: /shared/import/data, de su valor predeterminado.

Mensaje para llevar a casa: no lo cambies ya que se refiere a la ruta dentro del contenedor de importación de Docker, no en la máquina principal.

Tengo una pregunta sobre cómo reiniciar una importación.

No soy desarrollador, pero he logrado importar con éxito dos archivos mbox que provenían de un sistema llamado Topicbox Group Email. Hice mi importación de prueba en una instancia temporal de Discourse que configuré en Digital Ocean. Y pude importar mis dos archivos mbox de muestra en categorías existentes que ya había creado en Discourse, gracias a las notas sobre cómo configurar category.custom_fields["import_id"] = "mydir" de arriba.

¡Yay! Pero si quiero importar más archivos mbox, ¿tengo que ejecutar todos los comandos mencionados en la FAQ 2.2, que indica que “eliminará todo”?

2 Me gusta

¡Pude configurar mi “import_id” para dos categorías diferentes como una importación de prueba inicial. ¡Funcionó! Mis dos archivos mbox se importaron en las categorías existentes que especifiqué.

Tengo 18 categorías diferentes con las que necesito hacer esto. No sé nada de Ruby. ¿Puedo crear un archivo que establezca el nombre del directorio para cada una de mis diferentes categorías para no tener que ingresar manualmente cada línea en la interfaz de línea de comandos de Ruby?

2 Me gusta

Sí. Busca en Google “ruby for each”. Y crea una matriz con algunas de las categorías.

1 me gusta

No, no es necesario. El importador admite importaciones incrementales. Solo importará datos nuevos en la próxima ejecución. No ejecute los comandos mencionados en 2.2 a menos que desee empezar desde cero.

Lamentablemente, eso no es posible actualmente. Necesita asignar a cada categoría el import_id si desea importar en categorías existentes.

2 Me gusta

Gracias @gerhard por todo tu increíble trabajo en esto. No soy desarrollador, pero pude completar una migración desde un sistema de listas de correo llamado Topicbox. Pude obtener archivos mbox de Topicbox para importarlos a Discourse. Durante mis pasos de prueba y error, documenté todo en una publicación de blog. Así que, si está bien, quería pegar un enlace a esa publicación de blog para cualquier otro usuario de Topicbox que quiera convertir a Discourse.

4 Me gusta