Can some or all labels be preserved?
11 Answers
The most simple way to do this is activating pop3 or IMAP in your "Mail Settings" and retrieving the email using your own client (Thunderbird, Outlook, etc.).
-
I'd advise against POP3, which will make it very tricky to synchronise your email across multiple clients. It has to be IMAP. Commented Feb 27, 2016 at 13:56
One way is to log in using a mail client that supports IMAP. You can then export the emails to a backup location, but this is a bit laborious.
If you want a continuous backup, you could try something like imapsync. This would require you to run your own backup IMAP server and schedule a regular task to perform the synchronisation.
Edit: Preserving labels should work fine, but not quite in the way that Gmail handles them. I've not seen any IMAP or POP3 servers which handle the Gmail label system properly. Gmail presents each tag as a separate folder through IMAP, so as far as the user is concerned, the message exists in several places. (In fact, the inbox is just another label). If you synchronise your account to another IMAP server, you will essentially have multiple copies of the same message.
-
1More information on using IMAP to escape Google at the Data Liberation org. dataliberation.org/google/gmail Commented Jul 1, 2010 at 13:20
You can use a nice webapp (sic!) called Backupify to backup all your Gmail data (along with Twitter, Facebook and a bunch of other stuff).
Check out LifeHacker's answer to the same question.
In a nutshell, they said :
- a paid service like Backupify
- Gmail to Hotmail
- your favorite email client as IMAP
- unix 'fetchmail'
Gmail backups have become a somewhat timely topic, as thousands of Gmail users had their account reseted by accident recently.
Here's one more backup solution from the comments to that Engadget post:
I have all my GMail emails forwarded to my Hotmail account, of which all of the emails are downloaded locally on 2 different computers. I've had my Hotmail account since 1998, and I've never lost anything or had a problem so if GMail goes down, Hotmail will still work, and if that goes down, I have it all backed up.
Hopefully with this bump, we'll get even more good, up-to-date answers to the question. (At least gmail-backup.com, mentioned in the accepted answer, now seems defunct.)
-
Google takeout is still the canonical say to do it, the procedure is the same and no third party software or services are needed. Commented Dec 1, 2022 at 19:55
Backup your Gmail account for free, without 3rd party software
preserving labels, chats, threads, attachment and whatnot, in a usable portable format
The canonical way to backup the whole lot of your email messages (and a bunch of interesting stuff that Google kknows about you from bookmarks in chrome sync to workouts from Google fit, is trough their Google Takeout service.
why?
It used to be called "Data Liberation Initiative", back in the early year of the millennium, where the objective was making available all the information they collected about you, freely available in useful portable formats, because its "Your data" and if you want to change services, you should be able to take it with you effortlessly (try exporting your outlook.com emails, or a note from Evernote that is not in a proprietary format!)
But can i read them or import them elsewhere? are they in some funky JSON forma i'll need to write a parser for?
For Emails, they provide your data in MBOX files which is arguably the most portable format to store emails, thus preserving threads, headers, attachments, et al, and they can be importes seamlessly to a multitude of both online services and offline email reading packages.
Additionally you can do partial backups (some mailboxes are MASSIVE) by selecting a subset of your labels to be backed up.
Cool, i want in! (or out?)
- head over to https://myaccount.google.com and log in, under "Personal Info and Privacy", select "Control your content" or just follow this url: https://myaccount.google.com/privacy#takeout
- once there, select "Create Archive", which will take you to a screen of everything google knows about you.
- For the purpose of email backup, just deselect all services except Email. This will create an archive of all your email, or if you hit the disclosure triangle it will allow you to choose the labels to be backed up.
Once selected, click ok and scroll down to the bottom of the list of service and hit "Next"
It will then ask you whether you wish your archive to be compressed as .zip, a gzipped tar archive (.tgz) or a bzipped tar archive (.tbz) and whether you want the archive to be sent as a link o your email or dropped on your Google Drive for further cloud massaging, which is quite convenient
When you hit create, the service will start gathering your data from all over Googledom, a process that can take a few hours.
- When its done you'll be notified and your archive of emails will be available for a few days then google will delete it.
Your mailboxes are kept intact, your'e not "taking out" your data, just a copy or backup...
Needless to say, access to this servce requires that you reuthenticate even if you're already logged in, to prevent massive theft of data when carelessly leaving your account oppened. Also, you'll get deferred notificatios via email (sometime after the backup was done, and also when it is retrieved)
So tyhere you go.
I'm kind of find of IMAPSize. It's not the most fully-featured tool you'll ever find, but it backs things up in the most open way possible: each message in it's own file, which could easily be imported into any other e-mail client. It also includes an option for restoring from a backup (though I've never tested that).
Be careful when using IMAP mail clients for backups: I lost some mail at one point because I had thought Thunderbird was keeping local copies of things that it had decided it didn't need to keep. This was a config error on my part, but it's a warning to be careful.
Theoretically speaking, you can open up another gmail account and use it to pop your mail from the first account. You can chain this to have many different gmail accounts backing your mail up.
If you automatically label your messages, then you can redefine the filters in each account so that labels continue to apply.
-
2While this may guard against certain failures (one's own mistakes), it may not guard against others. File under "Do not put all your eggs in one basket." ;-) Commented Feb 28, 2011 at 14:45
-
1Its helpful if your gmail account is filling up and you want to split your mails in two accounts to have more space. So more like "put your eggs in two baskets of equal size but joined together, at least you can put more eggs" :-)– YasserCommented Feb 28, 2011 at 15:58
I developed Gmail Keeper for this. Why I've done that when there are other tools out there? Because I need to backup multiple Gmail accounts on a regular basis, and I don't want to input the login info each time when I need to make a backup.
Both emails and labels will be backed up to local disk in standard file formats (eml and zip). It can also backup the Gmail chat logs if you enable the 'Chats' folder access in the advance IMAP settings in Gmail. However, It's for Windows only.
Here are my steps for cleaning out an old gmail address or if its under a persistent phishing attack:
clean out all the notification
- I use a gmail filter on anything not coming from a personal email account, labeled as --lists and categorized as Promotions, by adding "from:(-{@gmail.com OR @hotmail.com OR aol.com OR example.net})" in the "Has the Words" field. Then I move things to Updates (and click "Do this for future..") on emails I want notifications on (as I have this label set to notify on Android). Unfortunately, moving and confirming 'future' doesnt create an exportable filter. Primary is my todo list, but I also route personal emails there.
- go into --lists label and check I havent missed anything, like ones I've starred. And then go to each label I have, like --saved, and select all and remove from lists. Then delete all in --lists.
- search for large files. Using "size:500kb" and/or "has:attachments", decide if I want to keep.
- view All Emails and use "has:nouserlabels" to see any unlabeled emails. Delete all Hangouts messages with "is:chat".
- also export my filters list (in XML)
I have a couple labeled folders of emails that I want to use in my new account. So I click "select All" and then "Forward as Attachment". This is great for a special TODO or MOVE folder. You will lose the order by date, as it is sorted by name, but any email addresses I might need or items to follow up on are accessible. You can also save these to Google Drive right from the forwarded email of bulk emails, if you want a quick and dirty method for backing up. You can create GDrive folders for each label and sort them and download folders zipped. There is an icon in Gmail on the forwarded email to download all attachments, but it doesnt seem to be working.
Speaking of contacts, for my personal account, I export them from the Contacts webapp backup the csv locally, and delete. This protects them if I get hacked, but I also forward the last message from a couple people I email most regularly.
Then I just use the gmail export at https://takeout.google.com/?hl=en or under Download Data in Account in MBOX format. It is a widely used format:
This format was originally used by Unix hosts but is now supported by other email applications, including Outlook and Apple Mail. - https://www.lifewire.com/how-to-export-your-emails-from-gmail-as-mbox-files-1171881
You can select "All Mail data included" and it will allow the selection of individual labels, and is also in MBOX format. There is a warning under "learn more" that messages with more than one label will be duplicated. I got 48mb instead of 25mb using "All Maill.." instead of plain MBOX. The latter only has the 5 main folders Inbox, Archive, Sent, Drafts and Starred. Also, careful if you have another account signed in and you select save to Drive, as the very last step "Manage your exports" may switch you to that account and not save the emails you just selected. Using download seems to work though.