If the contacts database is from SailfishOS 3.* then you will have problem if you just copy it to SailfishOS 4. Check The following post:
I wrote a conversion script in php that opens the .sqlite contacts database from SailfishOS 3 and generates a VCARD file. Since I didn’t lost all contacts, I also checked with the SailfishOS 4 contacts database to see what was missing. I hope it will help you. For commhistory I don’t have any ideas. Good luck on both.