How to backup and restore Gmail account on Linux

Hey there, how to backup and restore Gmail account on Linux? Gmail is a free, advertising-supported email service provided by Google. Users may access Gmail as secure webmail, as well as via POP3 or IMAP4 protocols. Gmail initially started as an invitation-only beta release on April 1, 2004 and it became available to the general public on February 7, 2007, though still in beta status at that time. The service was upgraded from beta status on July 7, 2009, along with the rest of the Google Apps suite.

And now Google Gmail is the most widely used web-based email service as of today. As a Gmail user, you may want to maintain a separate backup of all email messages in your Gmail account for personal archiving purpose. Email back up is also useful in case you want to change your Gmail address to a different one, or switch to a completely different email provider.

Gmvault is a freshly baked console-based application for Windows, Mac OS X and Linux OS that has been developed to change the way you backup and restore emails from multiple Gmail accounts. Even though it doesn’t offer you a GUI (Graphical User Interface) to perform the backup operation, the console application comes with a simple sync and restore commands support to quickly save emails on your hard drive and restore them to specified Gmail account.

Installation of Gmvault on Linux
To install Gmvault on Linux, you can use the standard Python package installation method with Pypi. As of this writing, the latest version of Gmvault is 1.8.1-beta, which I will install in the following.

After installation, an executable named gmvault should be created in gmvault-1.8.1-beta/bin directory.

Backup Gmail with GMVault
Before backing up your Gmail account, you need to change the settings of the account. Go to the Gmail settings. Under “Forwarding and POP/IMAP” tab, enable IMAP, and disable folder size limits. Under “Labels” tab, make “All Mail” and “Chats” folders available in Gmail IMAP. Save the changes in the settings.

Now create a local back up of your Gmail account by running the following command.
$ cd gmvault-1.8.1-beta/bin
$ ./gmvault sync your_login@gmail.com

The full sync (backup) operation can be performed using the following command.
$ ./gmvault sync your_login@gmail.com

Once you press ENTER, it will pop up a web browser window, asking you to log in to your Gmail account, and authorize Gmvault to access your Google account. After you have successfully granted Gmvault access to your Google account, press ENTER in the terminal to proceed. After that, Gmvault will start downloading all your email messages.

By default, Gmvault will archive your Gmail messages as gzip-compressed plain texts in ~/gmvault-db folder. However, you can change the backup folder by using –d DB_DIR switch with sync command. The quick sync mode lets you quickly scan and backup emails from last 2 months at default/specified location.

You can use the following command to perform quick backup operation.
$ ./gmvault sync –type quick your_login@gmail.com

Customize with GMVault
There are other options used to customize Gmail back up process.
$ gmvault sync [-d DB_DIR] [–resume] [–emails-only] [–chats-only] [-e] [-m] [–no-compression] gmail_address

In addition, you can choose to encrypt the emails saved in your email database (gmvault-db folder) to prevent unauthorized access. You can choose to encrypt your emails in the database with “-e” option, Blowfish encryption is used to encrypt downloaded email messages, and an encryption key is automatically generated and stored in ~/gmvault-db/.info/.storage_key.sec.

Restore Gmail with Gmvault
Restoring backed up email to Gmail account is easy. All you need is to enter the following command to restore backed up email archive to specified Gmail account.
$ ./gmvault restore your_login@gmail.com

You can also restore an existing Gmail backup to a different Gmail account (to change your Gmail address). Just specify your new Gmail account in the command. In this case, you will need to log into the new Gmail account, and grant access.
$ ./gmvault restore your_new_login@gmail.com

Conclusion
Gmvault certainly provides an easy way to backup and restore email archive to multiple Gmail accounts. Using the restore command, you can easily copy backed up email items to any Gmail account. Furthermore, the application has the ability to automatically resolve IMAP-related issues while creating email item database. You can check out different usage scenarios and supported sync and restore commands’ switches here. As of this post i am writing, the application is in beta testing phase and works on Windows, Mac OS X and Linux OS.