Move ghost blog to ubuntu
I've decided to stop using Vultr's VM due to a poor experience and will migrate my blog to a new VM on DigitalOcean. Luckily, since the blog runs entirely on Docker and stores data in volumes, I only need to export these volumes and import them to resolve the issue. Here are the steps:
-
Upload
compose.yml
andghost.config.json
to the new VM. -
On the old machine, export data from the
ghostdb
andghostdata
volumes:docker run --rm -v root_ghostdb:/data -v $(pwd):/backup alpine tar czf /backup/ghostdb.tar.gz -C /data . docker run --rm -v root_ghostdata:/data -v $(pwd):/backup alpine tar czf /backup/ghostdata.tar.gz -C /data .
-
On the new VM, import the data for both volumes:
docker run --rm -v ghost_ghostdata:/data -v $(pwd):/backup alpine tar xzf /backup/ghostdata.tar.gz -C /data docker run --rm -v ghost_ghostdb:/data -v $(pwd):/backup alpine tar xzf /backup/ghostdb.tar.gz -C /data
-
Start the containers using Docker Compose:
docker-compose up -d
-
Update the DNS A record to point to the new machine, and wait about 30 minutes for the changes to propagate.