You could do it in docker, that is how I was doing it. One container for SQL and one for headless Kodi. You could run that on a Pi.
You just have to backup your database and then import it on the pi.
Mysql dump should be able to handle that.
But like I mentioned when I was doing it with MariaDb this way it was corrupting the database, but then again I have a lot of things in that database, and everything else exccept the kodi db was fine.
So not sure what the culprit was. I had a daily MariaDB backup, so I was able to recover on a regular basis if corruption occurred.