(Original comment from scrumplex)
I was able to migrate my Docker Compose deployment. An issue I ran into was that file paths in the database were relative to immich's working directory, meaning that everything was prefixed with upload/. I was able to remedy this by replacing upload/ with my mediaLocation (which is also what the UPLOAD_LOCATION variable from my Compose deployment pointed to).
Note
This is what worked for my installation that is a few years old. I am not sure if newer installations behave differently. Some facts about my Docker Compose installation: