We have successfully used the Python code from https://github.com/jay0lee/got-your-back to export out G Suite or Google Apps emails without having to reset passwords or use the Google Takeout feature. If your organization is small enough to use the Takeout Feature it is extremely easy to use and to export your mail. However it does require that either the Admin user will need to log in as the end user, or the end user directly needs to initiate the backup. 


We have tried to use a number of online tools that do G Suite backups and PST or EML exports but this script is free and works extremely well. It also conforms to the import requirements including a maximum of 4 layers of depth, and not embedding an archive within an archive. 

You will export your email using this command:


./gyb --email username@domain.com --service-account 

after renaming your json file. One downside to the script is that it needs to be run independently for each email address in your domain. There is no bulk export. 


You will see the following progress notifications


Using backup folder GYB-GMail-Backup-username@domain.com
Got 77699 Message IDs
GYB needs to examine 77699 messages
GYB already has a backup of 7900 messages
GYB needs to backup 69799 messages
backed up 3800 of 69799 messages




The default export once successful will create a folder in the GYB directory with a Year for each year that exists in the G Suite Account. You can ignore the msg-db.sqlite file. 



GYB-GMail-Backup-username@domainname.com


ls -al


drwxr-xr-x  10 staff  staff      320 Apr 24 06:31 2016
drwxr-xr-x  14 staff  staff      448 Apr 24 06:29 2017
drwxr-xr-x   6 staff staff      192 Apr 24 06:26 2018
-rw-r--r--   1 staff  staff  2625536 Apr 24 06:31 msg-db.sqlite


cd 2017 (this is the year)


ls -la


drwxr-xr-x  31 staff  staff   992 Apr 24 06:29 1
drwxr-xr-x  31 staff  staff   992 Apr 24 06:27 10
drwxr-xr-x  32 staff  staff  1024 Apr 24 06:27 11
drwxr-xr-x  32 staff  staff  1024 Apr 24 06:26 12
drwxr-xr-x  28 staff  staff   896 Apr 24 06:29 2
drwxr-xr-x  32 staff  staff  1024 Apr 24 06:29 3
drwxr-xr-x  30 staff  staff   960 Apr 24 06:28 4
drwxr-xr-x  32 staff  staff  1024 Apr 24 06:28 5
drwxr-xr-x  30 staff  staff   960 Apr 24 06:28 6
drwxr-xr-x  30 staff  staff   960 Apr 24 06:28 7
drwxr-xr-x  32 staff  staff  1024 Apr 24 06:27 8
drwxr-xr-x  30 staff  staff   960 Apr 24 06:27 9


cd 1 (this is for January)


ls -la


drwxr-xr-x  20 staff  staff   640 Apr 24 06:29 10

drwxr-xr-x  18 staff  staff   576 Apr 24 06:29 11

drwxr-xr-x  21 staff  staff   672 Apr 24 06:29 12



cd 10 (this is the day)
ls -la

rw-r--r--   1 staff  staff   81692 Apr 24 06:29 159860f5d34b28ba.eml

-rw-r--r--   1 staff  staff    2330 Apr 24 06:29 159861a3f88ce3a9.eml

-rw-r--r--   1 staff  staff  150744 Apr 24 06:29 159862cd87e18e9a.eml

-rw-r--r--   1 staff  staff    5377 Apr 24 06:29 15986356a8111f25.eml


And in this folder, you can see the actual .eml files that have been exported. 

You should then archive and compress them 


tar -zcvf GYB-GMail-Backup-username@domain.com.eml.tar.gz GYB-GMail-Backup-username@domain.com

You will then need to share the *.tar.gz files from all users with us to import into the system. 

For all File Types Regardless of Method Used for Sending 

  1. No co-mingling of file types in a single zip file, directory or folder
  2. Supported compression formats:  zip, tar/.gz, 7z
  3. Avoid spaces in all file names or directory names.  
  4. Avoid special characters other than @ - _ or . in file names or directory names. 
  5. File extensions must be lowercase (.eml not .EML)
  6. Hierarchy of files should be less than 4 or fewer levels deep
  7. Names of compressed files should contain the company's name or sub-domain.