# Restore messages locally deleted before

**URL:** <https://forum.delta.chat/t/restore-messages-locally-deleted-before/2786>\
**Category:** Mutual Help\
**Created:** [November 7, 2023, 9:14pm UTC](https://forum.delta.chat/t/restore-messages-locally-deleted-before/2786 "2023-11-07T21:14:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [November 9, 2023, 12:46am UTC](https://forum.delta.chat/t/restore-messages-locally-deleted-before/2786/4 "2023-11-09T00:46:26Z")

</div>

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

> [@\[WORKAROUND\] Make new Delta Chat installation import old messages from IMAP directory](https://support.delta.chat/t/workaround-make-new-delta-chat-installation-import-old-messages-from-imap-directory/262):
>
> Expected behavior When I install Delta Chat I would want it to import all conversations in the IMAP directory DeltaChat. Actual behavior I install Delta Chat and only new conversations appear (those after the install). I can still see old ones in the DeltaChat directory in Thunderbird but they won’t appear on the Android app or Desktop app, even though the setting for reading this directory is enabled.

There is also a related feature request:

> [@Download old messages](https://support.delta.chat/t/download-old-messages/1693):
>
> Loading old messages is something very requested for a long time, perhaps one way to implement it is using the “Contact Request” window when loading messages: for new contacts, use a behavior similar to the “Contact Request” as before. for old contacts, show the messages in the corresponding chat, but also show them here in “Contact Request” until the user leaves this page.

> [@anon76174457](#):
>
> 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).

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.

---

_[View the full topic](https://forum.delta.chat/t/restore-messages-locally-deleted-before/2786)._
