Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coolify! #611

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Coolify! #611

merged 2 commits into from
Feb 4, 2025

Conversation

northeastprince
Copy link
Collaborator

@northeastprince northeastprince commented Jan 14, 2025

Migration Plan

Before operation commencement

M-minus A record's TTL (currently 10 minutes)

  • Merge DNS PR changing TTL

M-minus 0

  • Pause all job queues
  • Remove app server from LB pool and add temp server
  • Run Litestream restore command one last time to sync latest data
  • Smoke test on temp endpoint
  • Merge DNS PR changing destination to Coolify server
  • Unpause queues

@zachlatta
Copy link
Member

Thanks so much for doing this. Please use Postgres if you can instead of a volume. The VPS should be considered stateless

@northeastprince
Copy link
Collaborator Author

Won't Postgres be hosted on the VM?

@zachlatta
Copy link
Member

Yeah, but it'll be automatically backed up to the s3 backup destination so it can easily be restored.

@northeastprince
Copy link
Collaborator Author

The database is currently synchronously replicated to S3 with Litestream

@zachlatta
Copy link
Member

zachlatta commented Jan 14, 2025 via email

@northeastprince
Copy link
Collaborator Author

Oh, that's awesome! It looks like there might either be multiple Hack Club orgs in Hetzner Cloud (the one I have access to is owned by @maxwofford) or I just can't see the bucket in question. But this app needs persistent (not autocleaned like the backups one) storage anyway to store images and whatnot anyway, so should I just create a separate bucket under the org and use that one?

@northeastprince
Copy link
Collaborator Author

Additionally, I'll need permissions to merge DNS PRs to minimize downtime unless someone else wants to take point on this. Feel free to add anything I missed to the migration plan above!

@garyhtou
Copy link
Member

garyhtou commented Feb 4, 2025

@northeastprince let's schedule a time for us to do this together. How's tmrw 1pm PST?

In the meantime, go ahead and create the DNS PRs and link them here. (make sure the changing A record to point to Coolify server doesn't get merged yet)

@northeastprince
Copy link
Collaborator Author

That works!

@garyhtou
Copy link
Member

garyhtou commented Feb 4, 2025

# get dump
ssh [email protected]
cd /var/lib/docker/volumes/hackathons-storage/_data
sqlite3 production.sqlite3
.output ./dump.sql
.dump
.exit

# copy dump to new server
scp dump.sql [email protected]:/var/lib/docker/volumes/l0k04cg840sww008o4cos0gs_storage/_data/

# restore dump
ssh [email protected]
cd /var/lib/docker/volumes/l0k04cg840sww008o4cos0gs_storage/_data/
sqlite3 production.sqlite3
.read ./dump.sql
.exit

@zachlatta
Copy link
Member

If possible, my strong preference would be to use Postgres instead of SQLite for the DB. That will allow people to access the DB while the app is running, and simplify backups.

@northeastprince northeastprince merged commit 734c3a9 into main Feb 4, 2025
3 checks passed
@northeastprince northeastprince deleted the coolify branch February 4, 2025 22:48
@northeastprince
Copy link
Collaborator Author

If possible, my strong preference would be to use Postgres instead of SQLite for the DB. That will allow people to access the DB while the app is running, and simplify backups.

@garyhtou also pointed out the BI aspect which I hadn't considered - it's clear by now stats aren't going into the admin dashboard anytime soon 😆. I'll make sure to get around to migrating back soon!

@zachlatta
Copy link
Member

zachlatta commented Feb 4, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants