Fix restore of local db after downloaded prod data

I managed to sneak a half-baked solution through code review earlier.
This one actually works.
Merge pull request #259 from stianjensen/actually-fix-clone-prod-data

Fix restore of local db after downloaded prod data