DEV Community

Habil BOZALİ
Habil BOZALİ

Posted on • Originally published at habil.dev on

Transfer your Gmail messages to Google Workspace Group

Introduction

Transfer your Gmail messages to Google Workspace Group

Google Groups is an online service provided by Google that allows people with shared interests or goals to communicate and collaborate in a group setting. It serves as a platform for discussions, email-based communication, file sharing, and organizing events within a group of individuals.

There are several reasons why you might consider using Google Groups:

  • Communication and Collaboration
  • Community Building
  • Email Distribution
  • Access Control and Privacy
  • Integration with other Google Services
  • Archiving and Searchability

What if you have an old Gmail mailbox and want to transfer all the content into a Google group? Let's solve it together.

GYB

Got Your Back (GYB) is a command line tool that backs up and restores your Gmail account. GYB also works with Google Workspace (formerly G Suite / Google Apps) accounts.

Installation

Windows Users:

https://github.com/GAM-team/got-your-back/releases/Setup.msi.

Mac and Linux Users:

Open a terminal and run:

bash <(curl -s -S -L https://git.io/gyb-install)
Enter fullscreen mode Exit fullscreen mode

this will download GYB, install it and start setup. Follow the instructions and complete the setup.

Backup Gmail

gyb --email myoldgmail@gmail.com --action backup
Enter fullscreen mode Exit fullscreen mode

This command will create a directory and clone all the messages into it.

Google Workspace Setup

  1. Go to the Google Developers Console
  2. Select Yes and click "Agree and continue". It will take a moment for the project to be created.
  3. Click "Go to credentials"
  4. Click "New credentials" and choose "Service account key".
  5. Click "Select..." and choose "New service account".
  6. Give your service account a name like "GYB Service account".
  7. Keep JSON as the key type. Click "Create".
  8. Agree to create the service account without a role. Copy the client ID.
  9. Your browser will download a .json file. Save the file with the name oauth2service.json and put it in the same folder as gyb.py or gyb.exe.
  10. Go to Domain-wide Delegation in your Google Workspace Admin console
  11. Click "Add New".
  12. For Client ID, enter the Client ID from above.
  13. For API Scopes, enter exactly:
https://mail.google.com/,https://www.googleapis.com/auth/apps.groups.migration,https://www.googleapis.com/auth/drive.appdata
Enter fullscreen mode Exit fullscreen mode

Click "Authorize". Now, your service account setup is complete.

Start Migration

gyb --local-folder GYB-GMail-Backup-myoldgmail@gmail.com --action restore-group --use-admin admin@domain.com --service-account --email yourgroup@domain.com
Enter fullscreen mode Exit fullscreen mode

This command syncs your local backup into a specified Google Group.

Conclusion

In this article, we learned how to move the messages in your Gmail account to the Google group using GYB.

See you in the next article. 👻

Top comments (0)