Bug 414400

Summary: favorites, sent, drafts and templates folder are being changed
Product: [Frameworks and Libraries] Akonadi Reporter: Mathieu Jobin <opensource>
Component: IMAP resourceAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal CC: montel
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mathieu Jobin 2019-11-22 17:47:44 UTC
SUMMARY
This is quite major, when having a problem with Akonadi backend.
such as a distro upgrade, MySQL server upgrade. 
or a Migration trouble

> org.kde.pim.akonadiserver: "\nSql error: Duplicate column name 'version' QMYSQL: Unable to execute query\nQuery: ALTER TABLE SchemaVersionTable ADD COLUMN version INTEGER NOT NULL DEFAULT 0"
org.kde.pim.akonadiserver: Unable to initialize database.


we are in a situation, where the easiest is to delete the .local/share/akonadi/db_data folder

I don't want to remove the ~/.config/akonadi/ because I have many accounts and it is quite tedious to setup. I only do that every 2-3 years when I get a new computer.

I had the annoyance for a while about the favorite folders. everytime they were pointing to a new location. so I was removing them and recreating them. 


but today I was looking for the email I had just sent.. and it was no where to find found. I go into my settings.
and the folders for sent/template/drafts are pointing to totally random folder that are not even in the same IMAP account...



STEPS TO REPRODUCE
0. use favorite folders, set custom sent/draft/templates folder for your IMAP account
1. close kmail/kontact
2. akonadictl stop
3. akonadictl status # check
4. mv ~/.local/share/akonadi/db_data ~/.local/share/akonadi/db_data-last
5. akonadictl start
6. open kmail, check your settings.
7. be scared about the mess

OBSERVED RESULT
folders are wrong

EXPECTED RESULT
folders should be preserved

SOFTWARE/OS VERSIONS
Windows: Never in 25 years
macOS: Only when a gun is pointed at me
Linux/KDE Plasma: Yes, of course, , Kubuntu 19.10, packages
(available in About System)
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.64.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION
no pets, 1 wife, 3 kids

thank you
Comment 1 Mathieu Jobin 2020-02-17 00:19:28 UTC
IMHO critical
Comment 2 Mathieu Jobin 2020-12-07 09:00:48 UTC
CRITICAL IMO
Comment 3 Laurent Montel 2020-12-08 05:58:28 UTC
it(s not supported.
You removed/moved database so it will create new identifier for theses folders.
So for sure it will change.
We can't fix it.


Regards
Comment 4 Mathieu Jobin 2021-01-02 01:52:10 UTC
I had no choice to redo the data from scratch, since Akonadi would no longer start, I know that's a different issue

But favorite folder links could still be preserved.
Instead of a random generated ID, if it was a hash of the folder path?
Wouldn't that work better?

Thanks for considering this.