Restore from backup - Lightsail

I recently migrated my site (AWS lightsail) to self-hosted with docker. Is there an easy way to restore my backup to a new instance? I took these backups:

-rw-r–r-- 1 node node 8089600 Jul 22 19:16 2022-06-24-content.tar.gz
-rw-r–r-- 1 node node 70065 Jul 22 19:16 2022-06-24-database.sql.gz
-rw-r–r-- 1 node node 435 Jul 22 19:16 2022-06-24-json.gz

I did not see the docker container has ghost-cli installed, but it looks like it wouldn’t actually work right with docker since the containers are separated anyway (could be wrong).

I am using (nearly out-of-box) docker-compose now, with a MySQL container and the ghost container, so it looks like I could import the sql to MySQL manually, and I don’t really need the json, but the content file does not actually appear to be gzip’d properly…

tar -zxvf 2022-06-24-content.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

gzip -d also tells me:
gzip: invalid magic

But, just found out it is just a tar file which extracts file, so it never got gzip’d:

file 2022-06-24-content.tar.gz
2022-06-24-content.tar.gz: POSIX tar archive (GNU)

So, never mind, I think this is resolved, but leaving this here in case it helps save someone else some time.

So eventually I was able to restore, after modifying my dockercompose to:

version: ‘3.1’
image: ghost:4-alpine
restart: always
- 8080:2368
# see Configuration - Adapt your publication to suit your needs
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: password
database__connection__database: ghost
# this url value is just an , and is likely wrong for your environment!
url: http://localhost:8080
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
#NODE_ENV: development
- /var/docker/ghost/content:/var/lib/ghost/content:z
image: mysql:8.0
restart: always
- /var/docker/ghost/dbdata:/var/lib/mysql:z # Persist storage

And I got content and database imported properly. I can see the content of my previous posts etc, however, my main page is completely blank, anyone have any idea how to fix this?