How to rebuild your "On My Mac" Folders/Mailboxes after a backup or migration
I just spent nearly 3 hours trying to get an answer on this exact issue from AppleCare. Since the posts prior to mine were not very thorough, I decided to write this to help anyone who has this issue in the future. It is really quite simple.
After doing a time machine backup or a migration (in my case, I was migrating using Time Machine from a previous machine), do the following:
1. Quit Mail if it is open.
2. Go to Finder -> Library -> Mail -> Click on whatever file is there (in my case, it was named V2) -> Click on MailData
3. Select any and all Envelope Index files (in the MailData folder) and drag them to your desktop (I had 3 of these that I had to drag to my desktop).
4. Reopen Mail (and you will see all of those files being added to your new Mail. This will not effect any of your iCloud info; at least, it did not effect mine whatsoever.)
Just a note - if you are concerned that your emails are not there, you can actually see each one by going to Finder -> Library -> Mail -> V2 -> Mailboxes <----There you will see in that Mailboxes folder all of your previous "On My Mac" Folder/Mailboxes
Also, future note - it is much easier if you are a .Mac/.iCloud user to create a folder in that Mailbox. This also allows for remote access to that particular folder.
I really hope this helps someone else out! Good luck!