Gmvault: gmail backup (Ubuntu install and setup)

(edit 8/20/2012: Originally written for v1.5, this has been tested and works fine as of Gmvault v1.7-beta, so just change things accordingly and install away! I’ve updated the links below.)

I’ve been using getmail for over a year to backup my Gmail account. As far as I know, it’s been working, but it just grabs email over POP, dumps them into an mbox file, and that’s that. It’s a fairly basic procedure, but since it just blindly downloads emails, getmail doesn’t account for ones I’ve deleted, and I don’t know if it keeps any label information.

So along comes Gmvault, the new kid on the block with fancy restore features and multiple OS capability. Let’s give it a shot.

Python should be installed on a default Ubuntu machine, but let’s install a few other pre-requisites as well. I’m using Ubuntu 12.04 LTS (Precise Pangolin).

sudo apt-get install python python-setuptools
sudo easy_install -U distribute

Then download the source package for Gmvault:


Unpack it:

tar xvzf gmvault-1.7-beta-src.tar.gz

Then install!

cd gmvault-1.7-beta/
sudo python install

The basic setup is about as simple as it comes:

gmvault sync

The setup process will take you through an authentication process with your email account.

Since I ran the install on an Ubuntu headless server, it loaded the text-based w3m browser, which I was able to login to my account, but then was unable to approve Gmvault to access my email. Pressing ‘q’ quits the browser and you’ll be presented with with an OAuth link you can copy into a normal browser and authorize Gmvault that way. (Note: you can manage what apps can access your Google Account at any time)

Once Gmvault is given the okay, it’ll start churning away downloading emails. Give it a few minutes (or hours) to finish, and feel better knowing that your hoard of oh-so-important emails are now tucked away in yet another location.

There’s a few other parameters you can pass to the program, which will allow you to change the vault database location, provide a user/pass rather than the OAuth token, and to run custom synchronization of certain emails. Take a look at the in-depth documentation on Gmvault.

After running the initial sync, you can run the following command to run a quick sync (only the last 2 months are scanned):

gmvault sync --type quick

Restoration of emails appears to be straightforward (although I haven’t tried it) and emails are stored in month folders as individual .eml.gz and .meta files. The gzipping appears to be fairly efficient, as the Gmvault database reports to be about 2/3rds the reported size of my Gmail inbox. Not bad at all!

Also–for the sake of completeness, a few days after I wrote this I found out about BaGoMa, which is another Python-based utility to backup your Gmail. Seems to follow a similar path as Gmvault, but I like Gmvault’s ability to use OAuth rather than have to provide my password each time.

So far, Gmvault appears to have a simple and easy to use product that fits my needs. Good work!

This entry was posted in Software, System Administration and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.


  1. Posted November 25, 2012 at 9:40 am | Permalink

    Hi Jason, thanks for the straightforward instructions. It worked better with these instructions than with the official documentation! Now it is busy downloading the stuff. Nice!

  2. John Rose
    Posted February 1, 2013 at 1:30 am | Permalink

    I’d previouslt installed gmvault & used it. Suddenly it’s no longer found. Only reason that I can think of is having new version of Firefox installed under Ubuntu 32 bit Precise. Is that correct?

    PS Your instructions worked fine.

    • Posted February 1, 2013 at 9:12 am | Permalink

      John, I’m not sure how a Firefox update would have affected your gmvault install. You might check and see if the binary is still there (/usr/local/bin/gmvault is where mine is installed).

      • John Rose
        Posted February 1, 2013 at 11:06 am | Permalink

        Jason, It’s there now. But it would be as I reinstalled it. I’ll have to see if this happens again: if so, I’ll check before reinstalling.

  3. Posted July 3, 2013 at 2:12 pm | Permalink

    Jason, are you using a cron for this on an ongoing basis? if so, would you just run this as the command?

    gmvault sync –type quick

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>