[Guide] The easiest way to move plausible instance to new VPS #4389
Unanswered
myazaki
asked this question in
Self-Hosted Support
Replies: 2 comments 2 replies
-
👋 @myazaki Thank you for the guide! I would warn however to not delete the volumes (step 4) that contain the events data until you are completely, absolutely, 💯 sure everything was migrated successfully. |
Beta Was this translation helpful? Give feedback.
1 reply
-
For posterity: I recently wrote a blog post about this topic (I use another approach – I don't copy the volumes, but dumps of the Postgres / ClickHouse tables). See here: https://camillovisini.com/coding/migrating-plausible-analytics Hope this is helpful for somebody who comes across this in the future 🙏 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I decided to sum up all I did to move my existing plausible instance to new VPS. It turned out to be the easiest way comparing to others I found around the internet. It took me less then 10 minutes to migrate all and getting it up and running, but I do not have many data there.
I recently moved to Hetzner's cloud arm64 VPS, which is blazing fast, cheap a powerful comparing to my previous amd64 hosting platforms. Even the plausible website is much more responsive then it was before. I could notice it when browsing stats. It took me multiple tries before I got it working so it is is crucial to do it exactly in this order :-)
Requirements
new VPS ready with docker installed
Detailed step-by-step
1. Clone plausible dir on new VPS
Clone the dir with clickhouse folders etc and most importantly
docker-compose.yml
andplausible-conf.env
from old VPS to the new one using rsync. This is the command:2. Get it all up and running on new VPS
Enter the cloned directory
cd /srv/plausible
and runsudo docker compose up -d
, wait until all the images are downloaded and containers started, running healthy etc.3. Stop all containers on new VPS
Now stop all containers:
4. Delete all volumes on new VPS
Delete all the volumes which were created in the step 2 (few minutes ago)
sudo docker volume ls
sudo docker volume rm plausible_db-data plausible_event-data plausible_event-logs
5. Stop all containers on old VPS
Now move to old VPS and stop all the containers:
6. Clone volumes from old VPS to new VPS
Move to the new VPS and check your docker volumes directory. I chose docker to use
/srv/docker/
, yours can be the default/var/lib/docker/
, so adjust the URLs and clone volumes from the old VPS, again using rsync:7. Get it all up and running again on new VPS
Enter the cloned directory
cd /srv/plausible
and runsudo docker compose up -d
, wait until all the containers are running.8. Fix the webserver config and DNS
Depending on the setup you have, you have to change your webserver config and DNS settings. For myself it was only to clone Caddyfile and to replace CNAME target value with new VPS URL.
9. Test everything before deleting any data on old VPS
Make yourself absolutely 💯% sure that all works as expected before you delete the data on old VPS!!!
That's it, hope it helps someone, let me know :-)
Chers
Beta Was this translation helpful? Give feedback.
All reactions