Please help - restoring a backup from Ghost 2.11

Hi All,

I’m trying to figure out how to restore a backup from a ghost v2.11 to the latest version.

All the docs make it quite clear I need to upgrade to the latest minor version before upgrading major version. The latest v2 was v2.38.3, but github and npm only show version 2.37.0. That version is also marked as last of the migrations so I guess if I can get to that version it should be fine.

The problem is getting a working installation of 2.37+ - there’s no end of node warnings and errors about old versions of node, npm installations issues of dependencies that are end of life, incompatible versions of Ubuntu etc… etc… I’ve spent two days and three or four different Ubuntu VM installations trying to get a working setup but it’s a frustrating puzzle of interlocking dependencies that I can’t uncrack.

I did manage to get an npm i ghost@2.37.0 -g to complete on Ubuntu 22 with Node 18 but running ghost command at the end of it all shows command not found error.

How does one upgrade an old backup from 2.11 without a currently working installation?

Do I really need to upgrade the backup before I can restore it into a new installation? Or is that only for upgrading an existing installation?

Any help much appreciated.

Brad

Of course as soon as I posted this I think I figured it out. For anyone else struggling with this, this is what I did:

  1. Using Ubuntu 18 in VM
  2. Installed Node 10. Required waiting through a couple of long (20 sec then 60 sec) warnings about not supported.
  3. Installed an old version of ghost-cli
    sudo npm install ghost-cli@1.12.1 -g
  4. Installed v2.38.3 in a directory
    ghost install 2.38.3 --db=sqlite3
  5. Didn’t want to mess around with reverse proxy so changed the server config to:
    "server": {
        "port": 3000,
        "host": "0.0.0.0"
    },
    
  6. Managed to connect from outside the VM.
  7. Went though initial setup at http://vmname:3000/ghost
  8. Tried importing the 2.11 json backup…

But the import failed with:

Import failed

Validation (isIn) failed for type

{"group":"core","key":"db_hash","value":"9bf0afc3-8c34-4bc0-9992-64ff8c83adee","type":"string","flags":null,"created_at":"2020-12-08T22:36:19.000Z","updated_at":"2020-12-08T22:36:19.000Z"}

Finally, success.

Turns out even though the running ghost ls on the original server the installation as v2.11, I noticed in the top of the exported content json file, was it mentioned v3.39.3. Almost certainly my fault as I think I might have been on the wrong server at the time I checked the version.

Anyway, installed ghost 3.39.3 on my dev VM and it imported with just a couple of warnings.

1 Like

Nice work on figuring this out! Your notes will be really helpful for others (and us) when working with old versions of Ghost :grinning: