this post was submitted on 08 Jun 2023
11 points (100.0% liked)

Lemmy

496 readers
2 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS
11
Instance relocation (lemmy.click)
submitted 1 year ago* (last edited 1 year ago) by Lodion@lemmy.click to c/lemmy@lemmy.ml
 

I'm planning to move my instance to a new VPS provider that will allow me to scale more simply.

Has anyone done this already and can sanity check my plan? My current setup was spun up using the ansible playbook here.

Current plan is:

Lower DNS TTL to 60 seconds (already done)

Shutdown on current VPS: docker-compose down

backup /srv/lemmy// and copy to new host

sudo tar -zcvpf backup.tar.gz /srv/lemmy//

scp backup.tar.gz user@newhost

update dns A and AAAA records, wait 1 minute, verify DNS has updated

run ansible script

Shutdown on new VPS: docker-compose down

restore backup to /srv/lemmy//

Startup on new VPS with restored DB etc: docker-compose up -d

test

destroy old VPS

Increase DNS TTL to 86400

Anything I've missed? :)

top 7 comments
sorted by: hot top controversial new old
[–] Wintermute@lemmy.villa-straylight.social 4 points 1 year ago (1 children)

Seems reasonable to me, although I would think you want to shut down the old instance before you do the backup, otherwise you potentially lose any new data between when you take the backup and when you shut down the server.

[–] Lodion@lemmy.click 4 points 1 year ago (1 children)

Thats what the "docker-compose down" is for in the second step :)

[–] Wintermute@lemmy.villa-straylight.social 4 points 1 year ago* (last edited 1 year ago)

Derp. Note to self: don't make serious comments after 10pm. My brain skipped right over the word "new" in the line Shutdown on new VPS: docker-compose down.

[–] drk@slrpnk.net 2 points 1 year ago (1 children)

I'm not familiar with the details of setting up a Lemmy instance, but can't you already get the new instance up and running with a modified /etc/hosts instead of waiting for the DNS to be updated? That might reduce your overall downtime a bit.

[–] Lodion@lemmy.click 2 points 1 year ago (1 children)

Nah, part of the playbook sets up the initial Lets Encrypt certificate... so DNS needs to point to the new VPS. And the hostname needs to match the existing instance as it is referenced in the database.

Doesn't matter now anyway, I went a different route :)

[–] kiwi@lemmy.one 1 points 1 year ago (1 children)

How'd you end up migrating it?

[–] Lodion@lemmy.click 1 points 1 year ago

I didn't, I spun up an entirely new instance.

load more comments
view more: next ›