How to back up e-mail database

I have years worth of e-mail records that I have been storing in K9. I was always used to being able to copy the databases to a new phone when I switch phones, and have had no problems doing this. That was one of the features I liked and counted on. Now I notice that apparently the databases have been “upgraded” such that they don’t reside in internal shared storage anymore, but in internal root memory where I can’t access them to back them up. Is there any other way to back up the email database to move it to a new phone? Please note that I am referring to the e-mails themselves - not backing up the settings, as I have no problems doing that.

2 Likes

Backing up the message databases was never supported. It was an accidental feature.

In the previous version of K-9, there was a setting that allowed you the choice of locating your e-mail data either in the “internal” (root) memory, or in the “external” memory, which was the internal shared memory (not an SD card). Isn’t it possible to allow people that choice again?

The android permissions no longer allow access to all the system directory. Some apps still can but K-9 does not, So yeah, you can no longer do that anymore, and I dont know if the devs should work on that

As an alternative, I just tried Helium. Helium says that “K-9 Mail has disallowed backup of application data. Ask the K-9 developer to allow application data backup.” Is it as simple as it sounds for the Dev to make that change?

You could always use the ADB to make a backup. Just make sure to pass the parameter to include the data.

If this refers to adb backup, this basically is a setting in the manifest file. So it could be that easily, depending in the data structures involved, or it could be hard, if there’s more than just copying files.

1 Like

It’d be nice if K9 integrated with the Backup Service on Google Android phones to at least save settings and other local data to the cloud. But not sure years of messages would work as well.

Given how fragile phones are, I personally don’t keep any data of value on it that isn’t sync’d somewhere else.

So it’s 2023 and there’s still no way to backup K9 Mail o.O Looks like I’ll have to use another App on my new phone because this sucks hard AF :cry:

It’s almost 2024 and you shouldn’t be using POP any more, or at the very least NEVER use your phone as the only place to store emails. That absolutely defeats the purpose since phones can get lost, stolen or simply replaced.

Excuse me, who are you to prescribe others what to do?

There are people on the planet that don’t want Google to store TB of own email data so they use other servers that only have limited storage for free. I use one for almost 20 years now that only has a relatively small storage for free, so POP is the only option if I do not want to delete all mails older than a month.

On most of my emails I use IMAP but then again I have to delete large mails because I lack storage space and I want to keep them mails locally for the future, so I cannot import those local emails as well even if I do use IMAP.

Now even if I were listening to you and switch to IMAP for ALL clients. I still have the same damn problem - I cannot import my old mails, can I?

For other readers that have the same problem or constructively want to participate in the discussion:

If you only stored POP3 mails in K9 in an old phone and your old phone is not rooted, you’re fckd – you’re mails are lost, thanks to the highly secure Android file system and developers that know better what is good for you :crazy_face: I tried to find a solution for a few days now, adb backup and so on doesn’t work with K9, so you really are screwed. I surrendered.
K9 developers: Please consider this as a feature request to make backups of email data or at least allow them using adb – if I read correctly, this is just a flag in the app manifest file.

Workaround
If you also have other copies of your old emails (e.g. in Thunderbird on your computer, like me), a workaround is to copy those old emails to another IMAP email address using your computer’s email client.

Example:
Suppose your POP3 email is pop-mail@abc.de and your IMAP email is imap-mail@gmail.com
Create a new IMAP folder for imap-mail@gmail.com (e.g., with the name “old abc mails”) and then copy all your old pop-mail@abc.de emails into that folder. They will be uploaded to the server and you can then synchronize them on your new phone (in a different email account, but still – you have them for the future and can find stuff when you need it). This only works if you have sufficient storage for your old emails in your IMAP mail provider. If it’s not sufficient, you can limit the mails you copy to the most recent ones, for example.

1 Like

Since I asked the original question, I might as well let people know how I wound up handling my situation. Since the upgraded version of K9 didn’t allow me to back up my e-mail to move it to a new phone, I reverted back to the latest version before the upgrade, which still allowed backup. I then restored the email data from a previous backup to my phone and synced with Gmail to get caught back up again. So I have the ability to back up e-mail again. The only problem is that as I store increasingly more e-mail, the old version of K9 performs very slowly. I recognize that this was the reason that K9 was upgraded in the first place, so I can’t argue with that. It would just be nice to have access to it via ADB or some other path (or offer primary e-mail storage on an external SD card instead of internal only). And no - I don’t use my phone as the only place to store e-mails. That’s the whole point of backup - you can periodically back up to your main computer or external storage. It’s just a convenience feature to have e-mail on my phone and I like the features and structure of K9 otherwise.

1 Like