The literal translation is not "to my heart" but "to me to heart".
This is unnatural English but natural Latin.
I would say that grammatically the datives mihi and cordi are not linked (the way meo cordi would be); I would rather analyze the core of the sentence as cordi est and mihi as an added mention of the beneficiary.
Someone who benefits or suffers from an action can be indicated by dative in Latin.
E.g. Potesne mihi auxiliari? "Can you help me?"
One can translate "to be helpful" as auxilio esse, so "he was helpful to me" would be mihi auxilio fuit.
This is the same kind of double dative as you encountered, and the most common ones I can think of are cordi and auxilio.
It is quite typical to express the beneficiary rather than the owner in Latin.
For example, I would translate "I washed your car" as tibi currum lavi, meaning literally "I washed the car for you".
(As pointed out by fdb in a comment, this is more common for body parts. The genitive would work here as well, but would give a different emphasis.)
When the owner has something to gain or lose, I would prefer dative (irrespective of the case of the object being useful/washed/whatever).
But when there is no such benefit, a genitive (or a possessive pronoun in the correct case) is more natural.
If you are unsure, a genitive is safer, but there are indeed cases where the dative is more idiomatic.
This kind of dative is common with some verbs (e.g. deesse, auxiliari) and expressions (e.g. cordi est), and it might be simplest to learn them that way.
I should also remind you that the two datives mihi and cordi are unrelated.
You could also say mihi cor uritur, "my heart burns".
The key to understanding this structure is, in my opinion, to see the datives separately.
The kind of dative that mihi is here has multiple names.
These include dativus commodi, dativus incommodi (for negative effects), dativus ethicus, and dative of service.
The other dative cordi is of different kind, and could perhaps be called a dative of purpose or analyzed as a dative of possession.
There are also discussions of the double dative constructions in Latin grammars, as double datives are indeed quite common.
To me the exact nomenclature is not all that important; there is no need to classify everything in neat categories, as long as you understand what is going on.