how to use gyb with multiple google workspaces accounts

286 views
Skip to first unread message

Ivan Saavedra

unread,
Apr 28, 2023, 10:53:22 AM4/28/23
to got-yo...@googlegroups.com
Does someone try to make this setting? 

How can we set this? 

Matt Smith

unread,
May 4, 2023, 3:50:43 PM5/4/23
to Got Your Back: Gmail Backup
I wasn't able to find a great way to manage this.  I did it by manually managed the secrets, rotating them as needed to switch back and forth.   You could create a script todo it for you - I was migrating workspace accounts so I only needed todo it a few times.

On Mac:
1. Install and initialize Project 1
2. Backup secrets for Project 1
cp /Users/username/bin/gyb/client_secrets.json /Users/username/bin/gyb/client_secrets.json.project1
cp /Users/username/bin/gyb/oauth2service.json /Users/username/bin/gyb/oauth2service.json.project1
3. Remove secrets so you can initialize project 2
rm /Users/username/bin/gyb/client_secrets.json
rm /Users/username/bin/gyb/oauth2service.json
4. Setup Project 2 - I just ran the installer again, followed the instructions to setup the other workspace account
bash <(curl -s -S -L https://gam-shortn.appspot.com/gam-install)
5. Backup secrets for project2
cp /Users/username/bin/gyb/client_secrets.json /Users/username/bin/gyb/client_secrets.json.project1
cp /Users/username/bin/gyb/oauth2service.json /Users/username/bin/gyb/oauth2service.json.project1

Now to switch between them:
1. Use Project 1
cp /Users/username/bin/gyb/client_secrets.json.project1 /Users/username/bin/gyb/client_secrets.json
cp /Users/username/bin/gyb/oauth2service.json.project1 /Users/username/bin/gyb/oauth2service.json

2. Use Project 2
cp /Users/username/bin/gyb/client_secrets.json.project2 /Users/username/bin/gyb/client_secrets.json
cp /Users/username/bin/gyb/oauth2service.json.project2 /Users/username/bin/gyb/oauth2service.json

Matt Smith

unread,
May 4, 2023, 3:55:18 PM5/4/23
to Got Your Back: Gmail Backup
step 5 should be:

5. Backup secrets for project2
cp /Users/username/bin/gyb/client_secrets.json /Users/username/bin/gyb/client_secrets.json.project2
cp /Users/username/bin/gyb/oauth2service.json /Users/username/bin/gyb/oauth2service.json.project2

Stuart Smith

unread,
May 5, 2023, 1:21:43 PM5/5/23
to Got Your Back: Gmail Backup
You can also do this with the --config-folder option.  I can't find the documentation but it looks like this:

gyb --email <email inbox @ domain1 workspace> --config-folder /home/username/bin/gyb/domain1 --action backup
gyb --email <email inbox @ domain2 workspace> --config-folder /home/username/bin/gyb/domain2 --action backup

Each folder should have it's own client_secrets.json & oauth2service.json files
Reply all
Reply to author
Forward
0 new messages