If you've had problems migrating your older mail system to the new Kmail2 and it doesn't work, here are some tips. I've finally figured out how the folders and their subfolders in Kmail2 are organized if you use MailDir format It's not like a standard filesystem in that subfolders aren't contained in the parent folder, but in a hidden folder that is on the same level as the parent folder. So, if you have a folder such as /Personal in your local folder tree, other subfolders under /Personal will only appear if there is a folder named .Personal.desktop on the same level as /Personal that contains all the subfolders with their mail. Also be aware that all folders in the filesystem must have three subfolders: cur, new, tmp. The mail files will be contained in new if unread or cur if read. Look in dolphin under /home/username/.local/share/local-mail to see the actual configuration. Be aware that if you need to make changes to this filesystem to close out Kmail and/or Kontact before doing so. You may have to restart Akonadi - use Configure Your Desktop app > Workspace Appearance and Behavior > Akonadi Configuration. I spent a long time trying to get subfolders that were in the filesystem to display. I had to move them to a new hidden folder .foldername.desktop. Does this make sense? NO. There's no logic to it nor is it intuitive, but that's how it works.
EDIT addition: BTW the index files (.index, .ids) from older Kmail are no longer needed.