Restore appdata\roaming but gmail keeps deleting everything once connected

Hello: This is an unusual issue. My friend uses Emclient with Gmail. She accidentally deleted all of her email and emptied her recycle bin. I’m not sure how she did this - logging into Gmail web interface there are no messages in “all mail” or in trash to recover, they are all gone. This in itself is unusual as you can normally recover gmail messages from trash or by looking in All Mail for messages that have no tags. But whatever, no problem, she uses backblaze to backup her computer, and we have the appdata\roaming\emclient folder backed up.

So I restored appdata\roaming\emclient and fire up emclient and everything is there as expected. However, immediately upon connecting to gmail, all messages are removed from the emclient cache (because gmail thinks they are supposed to be deleted).

So I pulled the Ethernet connection, copied the restored data back to appdata\roaming\emclient, and started emclient again. Now I can see all the messages, and since it can’t connect to gmail, everything is visible to look at. The messages are fully downloaded and everything is there as it should be.

I thought I would just copy all the messages to a local folder, then reconnect to gmail, let the sync occur so everyone is happy and all emails are removed from emclient to agree with the current state of the mailbox on gmail. Then I thought I could copy them back, or even just leave them in the local folder. But emclient will not let me copy any of the messages without connecting to the server. The moment I try to copy them, the dialog to connect to gmail appears. If I cancel, it also cancels the message copy. I’ve tried changing the password on the server too, but no matter what I do, It wants to connect to the server before I can copy the message. The full message is downloaded and I can see them all, I just cant copy them or export them or do anything without connecting to the server. And of course the instant I do that, the sync begins and all the messages are deleted from emclient’s local cache.

I need to either force gmail to forget all the message ID’s that were deleted, so that when emclient connects, they will be uploaded back to the server, or I need to figure out how to copy the messages from the emclient cache to another location without having to connect to the server first. Or I need to somehow change the message ID’s in the emclient database so that gmail will think they are new messages that need to be uploaded to the server instead of deleted from the emclient client.

Any thoughts on how I can save the messages from emclient without having to connect to gmail?

Thanks,

Have you tried using the eM Client backup function (How to do a Backup of eM Client data | eM Client) once you have the emails available, and then afterwards connect and let it remove the emails from eM Client, then afterwards restore the backup?

Give that a try and see if it works.

thank you, I did try that. Sorry I meant to include that info as well. After restoring the backup, google immediately deletes the messages as well.

I actually did a test with my emclient and gmail, and the backup feature is implemented in such a way that the moment it is restored and you begin a sync, the server will drive the mailbox to reflect the server. So there is no actual ability to restore an IMAP mailbox, as the message ID’s apparently remain the same, and the server will just do what it is supposed to do.

This seems to be a strange way to implement the backup/restore, because if the messages were on the server correctly, then all we would need to do is connect and sync. The fact that we need to do a restore from Emclient backup should make it obvious that the server does not have the desired data, and we therefore want the server to keep all the restored messages. So I would think that the restore would force the messageID to be recreated so they look like a new message to the server and will remain. I’m hoping someone will have a utility or a way to manually update the message-ID’s or some other workaround. Thanks for your suggestion though.

That is because the primary storage is the server. When eM Client (or any IMAP email application) connects to the server, whatever is displayed in the application is replaced by what is on the server. Just like webmail.

But there is a way to retrieve selected data from the backup:

  1. Disconnect the computer from the Internet. This is important!

  2. Go to Menu > Settings > General > Backup. Disable Periodic Backup if it is selected and click on OK.

  3. Make a backup using Menu > Backup, so we can come back to the current database later.

  4. Restore the old backup that has the data you want to retrieve.

  5. Export that data you need. You can do that using Menu > File > Export > Export email to eml files. You can select whole directory trees, so it is fairly easy to do.

  6. Restore the backup made in step 3.

  7. Reconnect to the Internet.

  8. Import the data from step 5 using Menu > File > Import > Email (eml).

2 Likes

Thanks, I understand the primary storage is the email server. The issue here is all the emails on the server have been deleted, but they still exist in the EMClient cache, and I would like to copy them out of EMClient to a local folder. I have disconnected the Ethernet connection, restored the EMClient folder in %appdata%\roaming, and all the messages are visible. They are fully downloaded and I can read the full contents and access attachments. However when I try to copy them to a local folder, or export them to .EML files, I get a dialog box that states the message is not fully downloaded. This is preventing me from copying the messages to another folder, or exporting them. Is there any way to update emclient so that it thinks the messages are fully downloaded so that I can copy them or export them? This is strange how I can see them in the interface, but I can’t copy or export anything.

Did you ever get an update to this?

It is not an uncommon problem.

Please follow my instructions above.

Hello Gary

I have followed your instructions to the letter. It does not give the intended outcome which is why Sam Schultz asked his follow-up question which remains unanswered.

I hope you can help.

All the best!

Unfortunately if the messages are not fully cached, then you won’t be able to export them or copy them to another folder.

Thank you for the update. :+1:

Unfortunatelly this is a HUGE bug i think. Who ever would like to have a backup which DESTROY all data on source server? This actually rendered for my eM Client as not usable and will never ever recomend it to anyone.

I will have to restore manualy 3k messages on Gmail so i can keep all emails and work related things as they should be!!!

It isn’t a bug. With IMAP, the message store is the server. Restoring a backup in eM Client won’t destroy or restore the server data. It leaves the server exactly as it is, so as soon as the restore is complete, eM Client shows you what is on the server. If the data isn’t on the server before the restore began, it still won’t be there afterwards.

However, if you deleted messages from the server, and you have a backup where the messages were fully cached in eM Client when the backup was made, you can do a partial restore while offline to get them back, following the instructions here: How to restore backup in eM Client | eM Client

BUG and problem it is. As BACKUP in first place moved all emails at Gmail server as deleted (luckily “only” to Trash).
Thats mean, that now to restore Gmail server to be able to use it on other devices with all data as it was before → need to manually restore all emails from Trash to previous places.

BACKUP which DESTROY or delete or alter data on source as server is not BACKUP it is stupid functionality as when immediatelly after then you do RESTORE, it will never restore data as data on server are always in different state than you have on backup file. = your backup file is useless if you plan to be ever online with same account.

A Backup or Restore won’t change the server data.

A backup doesn’t delete or replace anything, it just takes a snapshot of the database. A restore won’t replace or change the server data at all, it will only affect local data that is not synced with a server.

Yes it how it should work… BUT it did not. I just tried Backup and it deleted all data on my Gmail account older than 50days (which was range set up for archiving).

And restore did restore data in eM client but immediatelly when update from server came, again all restored data in client were deleted and mirror the state on server.

Backups DON’T delete data.

But if you have setup automatic archiving, that will remove the messages from the server and store them locally. That is what it does.

Yes, as I said, a Restore won’t affect the server data. As soon as the restore is complete, eM Client will show you what is on the server. If you have deleted server data yourself, and you have it in a backup, please follow the restore link I gave before to restore partial data.

But if you used automatic archiving, you don’t need to restore that data. It is already in the Archive folders below your other folders.

Yeah thats the problem :frowning: Yeah you are right. Archiving was the problem.
Still problem is, when hit the restore it restore everything and then with update from server it all removes again.

So thats the problem which I am dealing now with.

Archiving doesn’t delete the messages. It just moves them to the Archive folder.

If you don’t want them in the Archive, don’t Restore. Just disable automatic archiving, and move the messages back to the server folder.

But if you enable automatic archiving again, it will move them back to the Archive folder. You can’t use automatic archiving and keep the messages on the server. That is not possible.

1 Like

Just tried it on separate account and yes there is a major problem.
When you have archived emails in archive → deleted from server and stored in archive at eM Client and then you use restore backup → you lose archive.

In general you have backup, which is useless as it will be overwriten by status on server, but also you lose archive as restore data from backup doesnt contain any archive.

tried on version 8 and on newest version 9.

so where the archive went? My expectation is that is lost as no one tested such functionality, not even considering that restoring backup is useless as if not at server side, your ALL data will be gone. Unless you forewer will have eM client in offline mode.

I tried to save data / emails by create archiving on restored backup in offline mode… but eM client doesnt create archive as most likely can work only online from server side thus again you lose all data.
This dependency on being online and keep all things only partially downloaded and processed is HUGE problem of eM client.