Migrate a mailing list to 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

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

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

It’s not NNTP but Rest API.

「いいね!」 3

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.

Google Takeouthttps://takeout.google.com/)を試しました。Google Workspace グループのオーナーになり、Google グループの会話をダウンロードできるようになりました。インポートはまだ作業中です。

このアプローチにはいくつかの欠点があります。

  1. 増分更新が必要な場合、フルデータを再度ダウンロードする必要があります。
  2. 選択したグループのデータのみをダウンロードすることはできず、代わりにユーザーがオーナーまたはマネージャーの権限を持つすべてのグループのデータがダウンロードされます。
  3. デフォルトで無効になっているため、Google Workspace 管理者と協力して Takeout を有効にする必要があります。
「いいね!」 3

@Anjana_Raghavendra_P 様 - このアプローチで簡単なインポートはできましたでしょうか?

ありがとうございます!

はい、takeoutからmboxファイルがダウンロードでき、元の投稿に記載されている手順でインポートできました。

その後、DiscourseのPAASサービスを利用しているため、ファイルをDiscourseの技術チームに提供したところ、コンテンツをDiscourseプラットフォームにインポートすることができました。

「いいね!」 2

それは嬉しいです。ありがとうございます!

settings.yml の最初の行 data_dir: /shared/import/data をデフォルトから変更した際に、@sturdy2 と同じ問題が発生しました。

教訓: 変更しないでください。これは、メインマシン上のパスではなく、インポート Docker 内部のパスを参照しています。

インポートの再開について質問があります。

開発者ではありませんが、Topicbox Group Email というシステムから提供された 2 つの mbox ファイルを正常にインポートすることに成功しました。Digital Ocean にセットアップした Discourse の一時的なインスタンスにテストインポートを行いました。そして、上記の notes about setting the category.custom_fields[“import_id”] = “mydir” のおかげで、すでに作成していた既存のカテゴリに 2 つのサンプル mbox ファイルをインポートすることができました。

やった!しかし、さらに mbox ファイルをインポートしたい場合、FAQ 2.2 に記載されているすべてのコマンドを実行する必要がありますか?それには「すべて削除する」と記載されています。

「いいね!」 2

最初のテストインポートとして、2つの異なるカテゴリの「import_id」を正常に設定できました。うまくいきました! 2つのmboxファイルが、指定した既存のカテゴリにインポートされました。

最終的にこれを行う必要があるカテゴリは18個あります。Rubyについては何も知りません。各カテゴリのディレクトリ名を設定するファイルを作成して、Rubyコマンドラインインターフェイスで各行を手動で入力する必要がないようにすることはできますか?

「いいね!」 2

はい。Googleで「ruby for each」を検索し、カテゴリのいくつかを配列として作成してください。

「いいね!」 1

いいえ、その必要はありません。インポーターは増分インポートをサポートしています。次回の実行時に新しいデータのみをインポートします。最初からやり直したい場合を除き、2.2に記載されているコマンドを実行しないでください。

残念ながら、現時点ではそれは不可能です。既存のカテゴリにインポートしたい場合は、各カテゴリに import_id を割り当てる必要があります。

「いいね!」 2

素晴らしい功績を上げてくださった @gerhard さん、ありがとうございます!私は開発者ではありませんが、Topicbox というメーリングリストシステムからの移行を完了することができました。Discourse にインポートするために、Topicbox から mbox ファイルを取得することができました。試行錯誤した手順をブログ記事にまとめました。もしよろしければ、Discourse に移行したい他の Topicbox ユーザーのために、そのブログ記事へのリンクをここに貼り付けたいと思います。

「いいね!」 4