If you use Gmail or hosted Google Apps, you might be interested in taking a backup of your data, such as emails, Drive documents, and calendar entries. Thankfully, you can usually export copy of your account data using Google Takeout.
If your hosted Apps account has Takeout disabled, then you can do a backup, it simply has a few extra steps.
Option 1: Google Takeout
This method is nice and simple. Simply go to the Data tools – Download your data page, and select which services you want to export:
It can be a bit eye-opening to see the amount of data Google has on you (Files, conversations, location history, etc). At this point, click through to “Prepare Download”. Depending on the size of your account, this may take as a coffee break, a few hours, or even an entire day.
If you check the box for it, you’ll get an email like this when your Download completes:
And this lets you fetch a single file:
The .zip file contains a series of folders, one for each service. The defaults seem to be:
- A unix mbox file
- Calendar
- One iCal file for each calendar
- Contacts
- One vCard file for each group.
- Drive
- Exports as PDF, docx, xlsx
Option 2: Export data from each service
Sometimes, Google Takeout isn’t an option.
Luckily, most Google services have some sort of data export built in. This means, if you have a new contact manager, or want to include your Drive in your PC backup, it’s still possible.
The export formats in these examples should match the Google Takeout defaults. Tab through each service t see how to export it:
If you are more tech-savvy, then the rest of this section will focus on helping you generate an mbox file containing a full backup of your email, the same format as Takeout uses. The best tool for that is a Linux program called getmail.
On Debian or Ubuntu Linux, issue this command to install getmail:
sudo apt-get install getmail4
For other package managers, see these directions.
First, you need to enable IMAP for your account, see Google’s article: Get started with IMAP and POP3, for the steps.
Now create a file at ~/.getmail/getmailrc, and configure it to read your email account via IMAP/SSL.
[retriever]
type = SimpleIMAPSSLRetriever
server = imap.gmail.com
port = 993
username = bob@mail.example.com
password = ....
[destination]
type = Mboxrd
path = ~/inbox
[options]
verbose = 1
getmail
After some time, you will end up with a large mbox file at ~/inbox, containing all of your mail.
If, for some reason, you need to use POP3 instead, then see this article on Gmail backup
Go to your contacts, and find a group. Check the box next to each name, and then find the Export button:
Select the vCard format here, as it’s the same format which Takeout would have used:
Google provides a share-able iCal link, which you can download once, but it is only available if your calendar is public.
So, if your calendar isn’t too sensitive, click “Share” and make the calendar public:
Go to “Calendar Settings”, find the iCal link. It may take a few minutes for the link to start working, but once it does, download it, and then turn off public sharing.
There is a small risk that somebody else loads your calendar while its public, so if this concerns you, then save the events individually.
Know how to export a different service? Send it in and I’ll add it to the list.
How do I use these files?
Google Drive’s files are exported in familiar formats. If you haven’t used an mbox, vCard or ics file before, then you will need to find a program which can read these for you.
Google’s support answer “Download your data: Per-service information” contains a list of files types which you’ll run into during this process, and suggests programs which can import them.