How to migrate the Ghost database from old to new versions

Almost a year ago, I moved from a country where the ISP let me keep port 80 open to one where the ISP's are regarded with the degree of contempt normally reserved for the DMV.

As part of this, I am sadly no longer running this blog on an Odroid, but ponied up for a VPS from DigitalOcean (who are awesome, incidentally). I figured it was as good a time as any to upgrade Ghost, and thought "Ugg, this is going to be a pain. I haven't updated since nearly the first version!".

I started Googling (and duckduckgoing) advice on how to migrate Ghost databases and saw remarkably little. I figured it would be a pain.

So, in case anyone else is searching for the same, all you need to do is:

  • Copy /ghost/content/data/ghost.db from the old to the new installation
  • Copy any images under /ghost/content/images (remember to use cp -r since Ghost stores images in a different directory for each month)

That's it! Props to Ghost for being so easy and not needing a huge migration. I understand you can use a Ghost labs option to export all your data as a JSON blob, but this wasn't in the earliest versions, so hopefully this saves someone some trouble.