Restore messages locally deleted before

The “Delete messages from device” option was inadvertently activated on my end device. As a result, some messages were deleted locally. However, they are still available on the server.

Is there a way to restore them locally?

You can move the messages to another folder on the server and then move them back into INBOX, they should be redownloaded.

As an issue often and for many, good master link2xt, and hard to figure out by oneself: maybe worthy a very core function of the app (advanced settings: restore/redownload all messages from the server and restore only all DC messages from the Server).

Here is a thread that documents workaround with moving the messages between folders:

There is also a related feature request:

The reason there is no such function is that the result of downloading old messages is not very nice: Delta Chat generally places downloaded messages below the last read messages so you cannot miss them and everywhere we assume that messages are processed in the chronological order as they are received, e.g. when we receive “Member added”, “Member removed”, group avatar changes and so on.

If we want to do it properly, we should find the lowest message UID that we know and download batches of messages with this UID-100 to this UID, process them ignoring any group member changes and key changes and place them where they are expected to be according to the Date header. This is a different way of processing the messages if we want to make it a nice user function rather than a workaround for an emergency situation.

As we don’t know which message belongs to which chat, we also cannot download only messages belonging to the chat when you scroll to the top of it and want to see more history of this particular chat. Best thing we can do is “download N more old messages” and sort them into the chats.

If you have another device which has history still saved such as your desktop, best thing to do is to transfer a backup from your desktop to the phone. Or you can restore your old backup, it will then download new messages in the correct order.

1 Like

Maybe my person thinks again to naive, good master Link2xt, but the batch, copy into temp folder, and back, seems no problem for email clients. The different is just that no other client is used to make it manual. Also creating folders seems to be no problem.

One function that runs creating a temp-folder, move all (DC) mails there, and back “…please wait…”. Likelike with “all messages”. Another step toward full email client.
Copy, create, move… maybe later as single advanced tools.

Again, IT-Dummy is thinking around, and much appreciation for care and steady Zuvorkommenheit.

We can easily implement a button “download +100 older messages” that does something similar without even moving the messages back and forth between the folders. But the result is not always nice because these old messages will be added to the end of the chat and so on, this is why we can only recommend this to users as an emergency workaround. If we implement it as a messenger function, we have to implement it properly, placing the messages where they should be, ignoring group avatar, member list and key changes and so on.

The most cases where such is required, is when people, frustrated out of what ever, delete the App, later install it/a new, or using new device: “new instalation”, good link2xt.

For example (currently not able to send because of a possible bug), my person would ‘love’ to delete the version, install new, and ask others to do so like-alike. While my person could manage the reload of old, anybody else could not without a week teaching… (and no, people make no back-ups, they use memory and time to store pictures, media, what ever). He suggested that it would be of much use to have backups stored on email server, and done even automaticaly)

And again, most (in this world) are not familar even with the idea of what’s an email, or email client, beyond being asked when touching issues for a google-account.