How I fixed my corrupt database

I was having a lot of shutdowns and EM CLient crashes due to bad RAM that I recently replaced. When that happens the database repair routine starts with EM Client in my case it takes over an hour since I have an 80 gig database on my HD. Since I have work to do I almost always now just cancel it and EM Client opens.

This works fine most of the time, but this can cause corruption in the database and it did in mine eventually, which only affected the Search function in not seeing the complete info in the From box of emails sent to me. When it searched it was able to find email addresses but not take in account the name of the Sender.

Here’s how I fixed it. I have 2 email accounts. Only one was affected so I first exported all emails in my Inbox and folders below it named OLD. I exported all Sent items also. It did take many hours, so I let it work late at night when I didn’t need the computer.

Menu/File/Export Choose EML files Choose folders to export. Then Import EML files and choose the destination. I chose a folder I created in Local Folders, so I could first see what I got first before replacing my Inbox and Sent box. once I made sure I had the correct number of emails I replaced my Inbox and Sent box with the newly imported emails.

In my case I always mark emails as read when I’ve reviewed them. So I had to mark all the imported emails as read including the Sent box to make the Smart Folders/Unread to work right.

If you ever do this, be sure to save the exported emails, because if this happens again it’s far quicker to export the newest emails than several years worth of emails. I also suggest storing very old email in the Local Folders, because if your Inbox does become corrupt it will likely corrupt all the folders underneath. So storing very old email in the Local Folders protect them

1 Like

You can just copy or move the messages from the original location directly to Local Folders. No export/import necessary.

Moving or copying the messages from the original location directly to Local Folders will keep the read/unread status. Very useful if you have a mix of read and unread. It will also keep the replied or forward tags, other tags (categories) and flags, which export/import does not.

A good idea and is already achieved with eM Client’s Automatic Archiving. It will automatically move messages based on age, from the Inbox (or other folders) to a Local Folder.

You can just copy or move the messages from the original location directly to Local Folders. No export/import necessary.<<

do you think that would have fixed my database problem dealing with searches? The export / import definitely fixed it

Moving or copying the messages from the original location directly to Local Folders will keep the read/unread status. Very useful if you have a mix of read and unread. It will also keep the replied or forward tags, other tags (categories) and flags, which export/import does not.<<

yes this is a better solution for that reason

storing very old email in the Local Folders, because if your Inbox does become corrupt it will likely corrupt all the folders underneath.

A good idea and is already achieved with EM Client’s Automatic Archiving.<<

cool, I’ve never tried that, I will - great idea

Thanks for all your excellent help, Gary

I tried the auto archive and did it manually just to see how it worked. I’m impressed. I like that it will do the archives every 7 days or whatever I choose and ask me if I want to archive at that time.

I’m especially pleased that in my searches I can include the archive folder. Now that the archive folders are created, do you think it would be ok for me to manually move more of my old emails into the archive folder?

With the Inbox archive folder can I create my own sub folders beneath it and will they be included in a search if “include archive folder” is checked? Or should I just add them all into the Archive folder. I have thousands of emails, I don’t want to overload a folder if that can happen.

Is the Archive folder safer from a database corruption than the Inbox? Because when I did have a database corruption that was not fixable, none of the Local Folders were affected. Do you think that’s going to be the same for the Archive folder, since it’s separated from the Inbox?

It is essentially the same thing. Export/Import from IMAP to Local Folders actually copied the messages from a specific folder in your database to another folder on your hard disk. Moving the messages from the IMAP folder directly to Local Folders within eM Client does exactly the same thing; their location on your hard disk would have changed.

Yes, you can do that. Just treat them as regular folders. The Automatic Archive feature ensures that the messages are kept within their folder hierarchy when moved, but afterwards you can move the messages around, or add or delete if you want.

Yes, they will be included.

I don’t think you can say that any folder is less likely to become corrupted than any other. But they have their own directory on your hard disk, so are not mixed up with your IMAP or even Local Folders. So in that respect they may not be affected. But it depends on where the corruption is.

image

Best solution is to also have regular backups, as that data will be stored separately from the database.

I moved all my old inbox folders to archive/my email address/inbox. So that they are now as subfolders under archive/my email address/inbox. If I go to my inbox and do a search and check “include archive folders” and current folder and sub folders. The search does include everything in my inbox plus archive/my email address/inbox, but it doesn’t search in the sub folders beneath archive/my email address/inbox.

Test this and see if it works on your end. If I go to archive/my email address/inbox and do the search there I do get search results for the inbox and all sub folders. These are great tips that will make things easier for me.