Restoring to new account

749 views
Skip to first unread message

David Phillips

unread,
Oct 6, 2021, 2:34:58 PM10/6/21
to Got Your Back: Gmail Backup
I'm transferring emails from one consumer account (reasons) to another. 

I get that I'll need to specify the new account on the command line in order to restore/populate emails into it, but do I need to set up an entire new project for the new account as well? I have RTFM, but that doesn't mean I fully understood it.

Many thanks.

jre...@challiance.org

unread,
Oct 7, 2021, 10:32:55 AM10/7/21
to Got Your Back: Gmail Backup
Dave,

You only need a single project with GYB working. Haven't done this in awhile so hopefully no syntax has changed but this should work, as long as you have the right permissions setup in the project (for --service-account) :

# account1 = old/source mailbox that you want to get copied somewhere
# account2 = destination mailbox that you want to copy to
gyb --email acco...@yourdomain.org --service-account
# this will create a local folder with the mailbox contents in it, in a sqlite database structure
gyb --email acco...@yourdomain.org --action restore --local-folder GYB-Gmail-Ba...@yourdomain.org --service-account
# the above assumes you're working completely out of the gyb.exe folder, if the export was moved add in the path before the folder name

If you want to restore to a specific new label, add --label-restored "label"

If you end up with an .mbox file (Google Vault/Takeout) that you want to do this to, the syntax changes a bit:
gyb --email acco...@yourdomain.org --action restore-mbox --local-folder <folder name that contains the extracted .mbox file> --service-account

Hope this was some help!
Z

David Phillips

unread,
Oct 8, 2021, 2:31:57 PM10/8/21
to Got Your Back: Gmail Backup
This is a big help.

Some of the sample addresses got truncated in your message.

I'm guessing that in your example, the first gyb command has account1 as the argument for the --email parameter, and the second gyb command has account2 in the --email parameter?

jre...@challiance.org

unread,
Oct 10, 2021, 10:28:56 PM10/10/21
to Got Your Back: Gmail Backup
Dave,

Yep, that's exactly right!
Z

David Phillips

unread,
Oct 29, 2021, 6:14:23 PM10/29/21
to Got Your Back: Gmail Backup
It might be that I'm trying to restore just one label, but I'm getting the following error on account2

unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.

When I used the link that GYB provided to go to account2, I got an error message from Google that account2 had not granted permissions. 

I'm going to try an --action-estimate on account2, and see what happens



David Phillips

unread,
Oct 29, 2021, 6:16:21 PM10/29/21
to Got Your Back: Gmail Backup
The error message from Google is: Error 403: access_denied
The developer hasn’t given you access to this app. It’s currently being tested and it hasn’t been verified by Google. If you think you should have access, contact the developer (account1)

David Phillips

unread,
Oct 29, 2021, 6:20:33 PM10/29/21
to Got Your Back: Gmail Backup
Finally, for tonight, assuming I finally get the new account to give permissions to the old account, should I be able to do:
gyb --email newaccount --action restore --local-folder GYB-oldaccountfolder --service-account -search "label:somelabel"

Jay Lee

unread,
Oct 29, 2021, 6:27:46 PM10/29/21
to Got Your Back: Gmail Backup
No, you can't do searches on restore. You need to do the search on the backup so that's the only thing backed up and then restore that.

Regarding the OAuth issues, it sounds like you need to add the other account as a tester to your project. Go to:


and make sure you've selected your project and add all the accounts as test users.

Jay Lee


--
--
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/c8ec7cc7-56b0-4f0b-8e4a-27ebbd9c40d3n%40googlegroups.com.

David Phillips

unread,
Oct 29, 2021, 6:35:45 PM10/29/21
to got-yo...@googlegroups.com
OK, so if I did a full backup, I should rename that folder, redo the backup with the labels I want, then do the restore. 

I'll add the other account as a tester after we get back from dinner.

THANK YOU!



--
David Phillips
At or about 37° 37' 54" N 77° 37' 09" W
Lose Not A Minute!


David Phillips

unread,
Oct 29, 2021, 10:26:03 PM10/29/21
to Got Your Back: Gmail Backup
Victory! Thank you for your help. Adding account2 into the test users, renamed the full backup, backed up the label I wanted, and took --service-account off the restore command line (both accounts are just normal Google accounts) did the trick.
Reply all
Reply to author
Forward
0 new messages