# Restore from backup - Lightsail

**URL:** <https://forum.ghost.org/t/restore-from-backup-lightsail/31520>\
**Category:** Developer help\
**Created:** [July 22, 2022, 7:48pm UTC](https://forum.ghost.org/t/restore-from-backup-lightsail/31520 "2022-07-22T19:48:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryptic\_silence](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cryptic_silence/32/18627_2.png) [@cryptic\_silence](https://forum.ghost.org/u/cryptic_silence)\
**Post date:** [July 22, 2022, 7:48pm UTC](https://forum.ghost.org/t/restore-from-backup-lightsail/31520/1 "2022-07-22T19:48:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cryptic\_silence](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cryptic_silence/32/18627_2.png) [@cryptic\_silence](https://forum.ghost.org/u/cryptic_silence)\
**Post date:** [July 23, 2022, 12:31am UTC](https://forum.ghost.org/t/restore-from-backup-lightsail/31520/2 "2022-07-23T00:31:01Z")

</div>

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

version: ‘3.1’  
services:  
ghost:  
image: ghost:4-alpine  
restart: always  
ports:  
- 8080:2368  
environment:  
# see [Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/#configuration-options)  
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](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  
volumes:  
- /var/docker/ghost/content:/var/lib/ghost/content:z  
db:  
image: mysql:8.0  
restart: always  
environment:  
MYSQL\_ROOT\_PASSWORD: password  
volumes:  
- /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?
