Transfer your Gmail messages to Google Workspace Group
Tags: googleworkspace, gmail, gyb
Published: 2023-07-01 19:31:21

---
title: Transfer your Gmail messages to Google Workspace Group
published: true
date: 2023-06-20 21:21:33 UTC
tags: GOOGLEWORKSPACE,GMAIL,GYB
canonical_url: https://habil.dev/transfer-you-gmail-messages-to-google-workspace-group/
---

## Introduction
 ![Transfer your Gmail messages to Google Workspace Group](https://images.unsplash.com/photo-1590893384694-5770006aa1bc?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8c2VhcmNofDIwfHxUcmFuc2ZlcnxlbnwwfHx8fDE2ODcyOTYwNDN8MA&ixlib=rb-4.0.3&q=80&w=2000)

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)](https://github.com/GAM-team/got-your-back/wiki#Introduction) 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](https://github.com/GAM-team/got-your-back/releases).

Mac and Linux Users:  
Open a terminal and run:

```
bash <(curl -s -S -L https://git.io/gyb-install)
```

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
```

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

## Google Workspace Setup

1. Go to the [Google Developers Console](https://console.developers.google.com/flows/enableapi?apiid=drive,gmail,groupsmigration)
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](https://admin.google.com/ac/owl/domainwidedelegation)
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
```

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
```

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. 👻