Backup question and suggestions

Is it correct to assume that I only need the sqlite database file if I just want to back up keys, account credentials, and contact information?

If I delete the BLOBDIR directory and later attempt to restore a backup with just the sqlite database file (without the BLOBDIR directory), would I encounter any errors?

I assume that improvments for the backup function are planned for Delta Chat (notably to encrypt the backup files). I would suggest some additional improvements:

  • Having some kind of checkbox asking the user if they want to backup account chats as well as account credentials and contacts, or just account credentials and contacts

  • Option to automatically compress backup files into a single archive (if the user is backing up multiple accounts)

  • Display the actual name(s) of the backup file(s), not just the name of the directory where it is saved. (I don’t know any easy way to navigate directory structures on Android, so the directory name doesn’t mean much to me.)

Is it safe to delete BLOBDIR from the backup if I only want to back up keys, account credentials, and contact information, or would that result in an error when I later go to restore a backup using just the sqlite database file?

i would not say it is “safe”, but it might work somehow :slight_smile: but it is definitely not recommended to alter database or structure in any way, this may result in all kind of issues in the future. guarantee ends here :slight_smile:

Thanks for answering. If it is not safe to do so then I will not delete BLOBDIR for now. The reason why I asked, if it was not already obvious, is that I would like to create a lightweight backup that will allow me to recover my account and contacts at any time, but because the backup bundles the chat messages with the account and contacts data, the backup file size can be hugely bloated, especially if there is a lot of multimedia in the chats.

When I looked at the backup directory structure, the BLOBDIR directory seemed to contain only chat messages/media, and so I speculated that it might be safe to delete it, but I won’t do that if there is no guarantee of safety.

Hopefully the backup feature will in future make it optional to include the chat messages, so it will be possible to make lightweight backups with minimal file size.

if you want to get rid of media, in android you can go to the “all media” screen and long press one item then “select all” and delete them:

1 Like

Thanks for this suggestion. I don’t necessarily want to get rid of media on my device, but I would like the option to exclude them from backups.

You can try exporting a backup, go into the created archive, delete all blobs, then import a backup and see how it goes. It should just work except that avatars will not be displayed and media files will be missing of course. This will not overwrite your existing account, so you will can delete this test imported account afterwards.

My laptop sometimes runs out of disk space and I see missing avatars, but desktop app does not fail because of this.

So importing a backed up account essentially creates a “duplicate” account which shows up as a separate account in the profile switcher? That’s interesting, it’s not what I would have expected. Good to know!

So I assume you have done this yourself and it works?

While I am tempted to do this myself, if @r10s says it is not safe and there are no guarantees that this will work, I am hesitant to do this, firstly because it will mean a lot more work testing every backup I make, and secondly because I assume there will still be a risk that even if the backup works when tested, maybe the backup will suddenly break with a future version of Delta Chat.