Restoring Miniflux

by shuba

I've been running miniflux on fly.io for a year and it's worked great, it's just pointlessly expensive. I can run it locally instead and it can communicate with my other services. I can access it over the internet through a VPN.

Fly recently deprecated their "legacy postgres" service and I needed to get a dump of the database. Fly doesn't let you see the secrets you've set for the database connection string, so you need to fly ssh console and echo $SECRET_NAME to remember if you weren't clever enough to write down the secret somewhere else in the first place.

From there, you can connect to the legacy database with psql by proxying the postgres service to a local port over ssh like so: fly proxy 15432:5432 -a <your-postgres-app-name>. From there, you can pg_dump the database.

I then stood up the new miniflux instance using docker compose. The container created the default schema on start, so I had to drop that database which involved first terminating the app's connection from within the postgres container like so: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'miniflux';, after that you can drop the database from a psql connection DROP DATABASE miniflux;. From there, I restored the old miniflux database without ownership or privileges information: pg_restore --no-owner --no-privileges -U miniflux -d miniflux dump_file.dump. This worked perfectly!