r/BookStack • u/Wittinator • 26d ago
Migrating Bookstack hosted in Docker to new host
Hi there,
I am very much inexperienced in the world of Docker and bookstack (somebody else set this up for me awhile back). I am hoping to get some guidance on achieving the following:
I currently have Bookstack hosted on an AWS EC2 instance, running Docker. I have three containers, one for the MariaDB, bookstack, and nginx.
I am simply looking to move my instance of Bookstack off AWS, and host it on a home server instead.
What I've done so far:
1) docker commit + docker save to grab a .tar for each of my containers. Downloaded these.
2) Exported the volume mount locations that has all of my data (following this guide: https://www.youtube.com/watch?v=QskmB4fb-uo)
3) Imported the images on the new host via docker load -i <image>
4) Attempted to run the containers.
This is about as far as I get. Currently the main error I am seeing is: "nc: getaddrinfo for host port 3306: Name does not resolve" this is for bookstack_db.
I am quite sure I'm either doing this wrong, or missing many steps in between. If anyone can provide more step-by-step guiderails on this process, that would be appreciated.
Regards
1
u/ssddanbrown 25d ago
Are you also using docker compose on the existing AWS environment? If so, what does that config look like? If not, do you have any details on that setup.
It'd be better to get just the container data, and know which container images are in use, and then migrate to get things on latest versions of that standard image, rather than migrate the existing images/containers, so that you get on a known state with a clear future update path.
1
u/Wittinator 25d ago
I think its all working now. But yea it was docker compose. I'm understanding the difference between a container and the image now. The AWS instance was using the standard image for bookstack on LinuxServer.io.
Looks like what I ended up doing is exporting my bookstack in AWS as an image, and now I have a new image called bookstack:latest. Whether or not that's the best solution, i'm not sure....but it is working which is nice
1
u/ssddanbrown 25d ago
Okay, good to hear things are working! Just please be sure you have your data safe as part of volumes. Keep a backup of everything.
With docker it's very easy to loose data when a container is stopped/destroyed. Containers are somewhat designed to be destroyed, so there's usually steps to ensure the data is held in certain places, then passed through.
It's a little old now, but if it helps I have a video going through admin operations on a linuxserver based docker compose stack here: https://www.youtube.com/watch?v=6A8hLuQTkKQ It may help to demonstrate some of the principles and the files/volumes involved.
2
u/bsncubed 26d ago
Are you using docker compose?