Restoring to a group

100 views
Skip to first unread message

Steve Larsen

unread,
Sep 23, 2019, 4:16:33 PM9/23/19
to got-yo...@googlegroups.com
Looking at the wiki, it seems that --service-account and --use-admin need to be specified.

So I have a command that looks like but attempting to restore with this it says that I have 
403: Insufficient Permission: Request had insufficient authentication scopes. - insufficientPermissions
 - Giving up.

gyb --email dwight-gro...@demo.cloudbakers.com --action restore-group --service-account --use-admin st...@demo.cloudbakers.com --local-folder GYB-GMail-Backu...@demo.cloudbakers.com

I'm backing up my admin account successfully with 

gyb --email st...@demo.cloudbakers.com --service-account

I am not backing up with this and if I try, I'm prompted to complete the scope request


Do I need to OAuth against my admin account in addition to using the oauth2service.json file with domain wide delegation?


Jay Lee

unread,
Sep 23, 2019, 4:24:22 PM9/23/19
to Got Your Back: Gmail Backup
Try running:

gyb --action check-service-account --email us...@domain.com

And follow provided instructions.

Jay

--
--
You received this message because you are subscribed to the Google
Groups "Got Your Back: Gmail Backup" group.
To post to this group, send email to got-yo...@googlegroups.com
To unsubscribe from this group, send email to
got-your-bac...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/got-your-back?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Got Your Back: Gmail Backup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to got-your-bac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/got-your-back/CAA0XtT3k0pF3Hgoi120jPPCLu3W9Xa%2Bufv4OUdXEi5Yar4B_gg%40mail.gmail.com.

Steve Larsen

unread,
Sep 23, 2019, 4:39:26 PM9/23/19
to got-yo...@googlegroups.com
Everything passes if ran against a user. It fails when running against the group.

steve@gam:~/gyb$  gyb --action check-service-account --email st...@demo.cloudbakers.com
 Scope: https://mail.google.com/                                     PASS
 Scope: https://www.googleapis.com/auth/apps.groups.migration        PASS
 Scope: https://www.googleapis.com/auth/drive.appdata                PASS
 Scope: https://www.googleapis.com/auth/userinfo.email               PASS

All scopes passed!
Service account 106882429921834188523 is fully authorized.


steve@gam:~/gyb$ gyb --action check-service-account --email dwight-group-archive@@demo.cloudbakers.com
 Scope: https://mail.google.com/                                     FAIL
 Scope: https://www.googleapis.com/auth/apps.groups.migration        FAIL
 Scope: https://www.googleapis.com/auth/drive.appdata                FAIL
 Scope: https://www.googleapis.com/auth/userinfo.email               FAIL
Traceback (most recent call last):
  File "gyb.py", line 2132, in <module>
  File "gyb.py", line 1480, in main
  File "gyb.py", line 1071, in doCheckServiceAccount
UnboundLocalError: local variable 'credentials' referenced before assignment
[20706] Failed to execute script gyb


I removed myself as a Member of the group in addition to getting an OAuth directly on my user, then started to get the following error.

steve@gam:~/gyb$ gyb --email dwight-gro...@demo.cloudbakers.com --action restore-group --service-account --use-admin st...@demo.cloudbakers.com --local-folder GYB-GMail-Backu...@demo.cloudbakers.com

Using backup folder GYB-GMail-Backu...@demo.cloudbakers.com
Groups supports restore of messages up to 25MB
Traceback (most recent call last):
  File "gyb.py", line 2072, in <module>
  File "gyb.py", line 1926, in main
sqlite3.OperationalError: cannot DETACH database within transaction
[20460] Failed to execute script gyb


I noticed gyb needed to be upgraded and then get a similar, but just nicer formatted error of the same.

steve@gam:~/gyb$ gyb --email dwight-gro...@demo.cloudbakers.com --action restore-group --service-account --use-admin st...@demo.cloudbakers.com --local-folder GYB-GMail-Backu...@demo.cloudbakers.com

Using backup folder GYB-GMail-Backu...@demo.cloudbakers.com
Groups supports restore of messages up to 25MB

Will GYB just fail if it finds any message 25mb+ and not restore any which seems to be what is happening?

Also, I presume the wiki needs updating to 25mb now?
"The Groups Migration API supports a maximum message size of 16mb so not all Gmail-stored messages can be imported into a group."

Steve Larsen

unread,
Oct 4, 2019, 7:11:21 AM10/4/19
to got-yo...@googlegroups.com
TLDR; Finally got it to mostly restore, but with more questions on head scratching responses

When I looked in the GYB-GMail-Backu...@demo.cloudbakers.com folder there were all the sqlite files for restores I had done to other user inboxes. There was also the dwight-gro...@demo.cloudbakers.com-restored.sqlite file in there now too.

I ended up blowing away the entire backup and then starting again, this time I backed up with a search on message size. But that showed me 470 messages and I only had 450 before without the search which was really odd.
gyb --email dwight....@demo.cloudbakers.com --service-account --search "smaller:20M"

Screenshot 2019-10-04 at 06.06.55.png

Ran the same command on the new back and it mostly worked
gyb --email dwight-gro...@demo.cloudbakers.com --action restore-group --service-account --use-admin st...@demo.cloudbakers.com --local-folder GYB-GMail-Backu...@demo.cloudbakers.com

I ended up with a bunch of Unable to parse the raw message errors but for those that did parse, they restored.

Screenshot 2019-10-04 at 06.05.09.png

Steve Larsen

unread,
Oct 4, 2019, 7:20:16 AM10/4/19
to got-yo...@googlegroups.com
Figured out that the 20 extra, the 470, is because a search also backs up Hangout Chat messages and that would then explain the unable to parse errors too I guess.

So now I'm wondering..how can I ensure that I backup Hangouts Chat messages on all backups

How can I then identity those specific messages without looking into every eml file to see a difference
Screenshot 2019-10-04 at 06.17.42.png



Reply all
Reply to author
Forward
0 new messages