Correct way of backing up WhatsApp messages

At first I thought this was straight forward. On my phone I did this: “Send-only” folder /storage/emulated/0/WhatsApp/Databases

On my PC server this syncs with a “send-and-receive” folder /backups/myphone/WhatsApp/Databases

Everyday WhatsApp creates a full backup of all messages and stores it in a new .db.crypt12 file. This happens every day and the files are stored up to 12 days ago. this means WhatsApp deletes the oldest file when it creates a new one.

On my server, I expect to get a whole bunch of these files, as my phone is pushing the new file every day (Send Only) and nothing gets deleted on the server.

Goal: The only reason I am backing up WhatsApp is in case I lose my phone or if it suddenly breaks. On the new phone I want to be able to load the latest messages backup stored on the Server PC.

With that in mind, I wonder if my current configuration isn’t overkill, since I will be backing up 1 backup file per day every day without limits. I don’t have much use for that many backup files since each file is already a full backup. I care for the most recent ones only.

What would be the best way to go about this? A 2 way sync? That might be safe and count as a backup sincd I cannot imagine a situation where my WhatsApp phone data gets erased, but SyncThing is still running on the phone and syncs 2 way with the server, deleting all those files. But maybe it is a risk? Are there other ways to configure SyncThing for this particular case?

“Send only” means changes are only propagated outwards, not accepted from anyone else. It does not mean deletes are not propagated.

In this setup you should always have a mirror on the server of what’s on the phone.

1 Like

As calmh already said, your current send-only folder will delete files on your server once they are deleted on your phone.

Because syncthing is not a backup application, you need an additional safety layer that actually backs up these files. You’ve already figured out one potential dangerous scenario:

This is indeed something that can happen (altough unlikely) and thus is a risk (note that this also exists in send-only mode, it’s unrelated to send-receive). There are also thousands of variations of this (ranging from software bugs to hardware failures) that could lead to inadvertent file deletion on your server.

To protect against this, you need to secure the data on the destination. A simple way of doing this is by simply duplicating the files on the server to another directory, in a secure mode using another application (you can also delete older files there, but make sure that there is no corner-case that will delete everything). Syncthing has inbuild file versioning (which would store deleted files in a separate directory), but relying on this as a whole backup strategy is probably not a good idea. I don’t want to discuss all types of backup strategies here, but rule of thumb is that storing important data redundant is preferable.

PS: Syncthing also has an advanced setting called “ignore deletes” that might prevent deletions, but my opinion on that is similar to file versioning - do not use that for backups.

Yes my PC server has multiple other ways of backing up. This discussion is purely to understand how to sync the files to the server in such a way they are one of these 2:

  1. deleted on the server when that makes sense. In the case of Whatsapp (and Signal) messages, the send-only method is perfect for me to prevent useless files in my backup system.
  2. never deleted on the server by an event on the client device. In the case of my Pictures folder on Android, I want send-only from Android, but I do not ever want that device to be able to delete Pictures/files on the server. In this case “ignore deletes” on server side for this folder makes sense.

Reason: I select the photos in the camera (/DCIM) folder that are precious, those are moved to /Pictures with the desire to securely backup them on the server.

So I use Syncthing to get files to my server as efficiently and smart (with the extensive Run Conditions) as possible.

Next step on my server: Pictures get moved (keeping that folder from growing indefinitely) to a different folder with all my photos. This folder is part of photo management that I should do more often and this folder and gets backed up on a seperate HDD as well. The whole harddrive SyncThing writes on is part of my SnapRAID setup, parity is calculated every night.

I use ST to send both WhatsApp (/storage/emulated/0/WhatsApp) and Signal (/storage/emulated/0/Signal/Backups) to my RaspberryPI 3B. I only start ST after both apps have done their daily backup and then turn it off. Both folders are default send/receive on the phone and PI. A daily rclone cron job on the PI sends the backups to rsync.net, which has ZFS immutable snapshots of the last 7 days.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.