Restoring to a group

1,416 views
Skip to first unread message

Étienne Rivest

unread,
May 10, 2016, 4:58:36 PM5/10/16
to Got Your Back: Gmail Backup
Hello, 

I need to restaure a backup, successfully performed with GYB from an email account to a group. (I can correctly restaure backups to email accounts.)
We have a Google Apps for Education account.

I used different commands.

gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Back...@subDomain.org" --use-admin super...@domain.org
It returns:
Using backup folder GYB-GMail-Back...@subDomain.org
restoring message 1 of 922 from 2016-05-08 19:10:40

403: Insufficient Permission - insufficientPermissions

Note, super...@domain.org is a Google Apps super-admin. He also created the group and is owner of the group.
super...@domain.org authenticated correctly, and the super...@domain.org.cfg was correctly created in the same folder than GYB.

gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Back...@subDomain.org" --service-account
It returns:
Traceback (most recent call last):
  File "<string>", line 435, in buildGAPIServiceObject
  File "oauth2client\util.py", line 137, in positional_wrapper
  File "googleapiclient\discovery.py", line 203, in build
  File "googleapiclient\discovery.py", line 249, in _retrieve_discovery_doc
  File "oauth2client\client.py", line 598, in new_request
  File "oauth2client\client.py", line 864, in _refresh
  File "oauth2client\client.py", line 933, in _do_refresh_request
oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1503, in <module>
  File "<string>", line 902, in main
  File "<string>", line 437, in buildGAPIServiceObject
AttributeError: 'HttpAccessTokenRefreshError' object has no attribute 'message'
gyb returned -1

I followed carefully the indications supplied in the Wiki. Although the interface changed somehow, easy to do the process. I renamed the downloaded .jason file into oauth2service.json (beginning with letter o, not digit zero).
As I read in other threads in this forum, I tried to supply the Client ID, the key ID, the email address of the service account in the Google Apps console. Only one figure worked to register the service account to use the API, the Client ID. I also tried to add the Client ID, the Key ID and the email address of the service account after the --service-account parameter, as I read somewhere. I only generated the usage: gyb [... message.

As you can note, our organization has a main domain (domain.org) and two subdomains (or suborganizations in the google context). What I understand is that the super admin as well as the service account have domain wide rights, including the subdomains. This is true at least about the super admin which manage the main domain and the subdomains.

What am I doing wrong?

Thank you very much for your help!

Étienne Rivest

unread,
May 10, 2016, 5:00:27 PM5/10/16
to Got Your Back: Gmail Backup
I forgot to mention that I use GYB 0.45a on Windows 7, 64 bits.


Le mardi 10 mai 2016 16:58:36 UTC-4, Étienne Rivest a écrit :
Hello, 

I need to restaure a backup, successfully performed with GYB from an email account to a group. (I can correctly restaure backups to email accounts.)
We have a Google Apps for Education account.

I used different commands.

gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Backup-emailA...@subDomain.org" --use-admin super...@domain.org
It returns:
Using backup folder GYB-GMail-Backup-emailAccount@subDomain.org
restoring message 1 of 922 from 2016-05-08 19:10:40

403: Insufficient Permission - insufficientPermissions

Note, super...@domain.org is a Google Apps super-admin. He also created the group and is owner of the group.
super...@domain.org authenticated correctly, and the super...@domain.org.cfg was correctly created in the same folder than GYB.

gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Backup-emailA...@subDomain.org" --service-account
It returns:
Traceback (most recent call last):
  File "<string>", line 435, in buildGAPIServiceObject
  File "oauth2client\util.py", line 137, in positional_wrapper
  File "googleapiclient\discovery.py", line 203, in build
  File "googleapiclient\discovery.py", line 249, in _retrieve_discovery_doc
  File "oauth2client\client.py", line 598, in new_request
  File "oauth2client\client.py", line 864, in _refresh
  File "oauth2client\client.py", line 933, in _do_refresh_request
oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1503, in <module>
  File "<string>", line 902, in main
  File "<string>", line 437, in buildGAPIServiceObject
AttributeError: 'HttpAccessTokenRefreshError' object has no attribute 'message'
gyb returned -1

Étienne Rivest

unread,
May 19, 2016, 3:02:00 PM5/19/16
to got-yo...@googlegroups.com
Found it

I didn't note, at first use, how to add permission "5) Group restore" when authenticating a user. I thrown my old authentication file (us...@domain.com.cfg) that had only 0) and 6) as the default configuration. I first typed 5-<return> to add the Group restore permission (that is now starred) before typing 7) continue. This is somehow simple, but old DOS reflexes weren't there...

Select the actions you wish GYB to be able to perform for em...@domain.org

[*]  0)  Gmail Backup And Restore - read/write mailbox access
[ ]  1)  Gmail Backup Only - read-only mailbox access
[ ]  2)  Gmail Restore Only - write-only mailbox access and label management
[ ]  3)  Gmail Full Access - read/write mailbox access and message purge
[ ]  4)  No Gmail Access

[*]  5)  Groups Restore - write to Google Apps Groups Archive
[*]  6)  Storage Quota - Drive app config scope used for --action quota

      7)  Continue
7

Now, the command 
gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Backup-emailAccount@subDomain.org" --use-admin super...@domain.org

works properly.

Hope this may serve others.

Étienne Rivest | Adjoint aux technologies
L’École de danse de Québec 418.649.4715, poste 235
----------------------------------------------------------------------------------------------
eri...@ledq.qc.ca | www.ledq.qc.ca | www.facebook.com/ledq.qc.ca
----------------------------------------------------------------------------------------------

2016-05-10 17:00 GMT-04:00 Étienne Rivest <eri...@ledq.qc.ca>:
I forgot to mention that I use GYB 0.45a on Windows 7, 64 bits.

Le mardi 10 mai 2016 16:58:36 UTC-4, Étienne Rivest a écrit :
Hello, 

I need to restaure a backup, successfully performed with GYB from an email account to a group. (I can correctly restaure backups to email accounts.)
We have a Google Apps for Education account.

I used different commands.

gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Back...@subDomain.org" --use-admin super...@domain.org
It returns:
Using backup folder GYB-GMail-Back...@subDomain.org
restoring message 1 of 922 from 2016-05-08 19:10:40

403: Insufficient Permission - insufficientPermissions

Note, super...@domain.org is a Google Apps super-admin. He also created the group and is owner of the group.
super...@domain.org authenticated correctly, and the super...@domain.org.cfg was correctly created in the same folder than GYB.

gyb --email aGr...@subDomain.org  --action restore-group --local-folder "GYB-GMail-Back...@subDomain.org" --service-account
It returns:
Traceback (most recent call last):
  File "<string>", line 435, in buildGAPIServiceObject
  File "oauth2client\util.py", line 137, in positional_wrapper
  File "googleapiclient\discovery.py", line 203, in build
  File "googleapiclient\discovery.py", line 249, in _retrieve_discovery_doc
  File "oauth2client\client.py", line 598, in new_request
  File "oauth2client\client.py", line 864, in _refresh
  File "oauth2client\client.py", line 933, in _do_refresh_request
oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1503, in <module>
  File "<string>", line 902, in main
  File "<string>", line 437, in buildGAPIServiceObject
AttributeError: 'HttpAccessTokenRefreshError' object has no attribute 'message'
gyb returned -1

I followed carefully the indications supplied in the Wiki. Although the interface changed somehow, easy to do the process. I renamed the downloaded .jason file into oauth2service.json (beginning with letter o, not digit zero).
As I read in other threads in this forum, I tried to supply the Client ID, the key ID, the email address of the service account in the Google Apps console. Only one figure worked to register the service account to use the API, the Client ID. I also tried to add the Client ID, the Key ID and the email address of the service account after the --service-account parameter, as I read somewhere. I only generated the usage: gyb [... message.

As you can note, our organization has a main domain (domain.org) and two subdomains (or suborganizations in the google context). What I understand is that the super admin as well as the service account have domain wide rights, including the subdomains. This is true at least about the super admin which manage the main domain and the subdomains.

What am I doing wrong?

Thank you very much for your help!

--
--
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 a topic in the Google Groups "Got Your Back: Gmail Backup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/got-your-back/BTJw_3xXTrc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to got-your-bac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages