Hey, sorry to hear your database is down. Bugs me when that happens to my own apps so I completely get where you’re coming from.
Just so we’re on the same page, my aim here is to bring up a new database instance with your existing data intact. I’m not very interested in determining why the existing instance crashed and just want to get your data out of it. We’ll start by getting access to the database files, bring them up in a new machine so we can dump them to SQL, then load that into a new instance. You may be able to skip the second step entirely if you like living dangerously, but problems will probably be a bit more difficult to debug if you just bring up the old database in a new instance and something breaks.
Destroying a machine doesn’t destroy its attached volumes. Let’s start by finding the volume with your data:
fly m status <machine ID of busted Postgres>
Look for a line like:
Volume = vol_2yxp4mng75zr63qd
That’s the volume containing your data. Make a note of it. Then:
fly m destroy --force <ID of doomed Postgres>
Hopefully that database isn’t too cursed and can at least be force destroyed.
Then reattach that volume into a new machine. Check out fly m run
, pick an appropriate incantation for your needs, and make sure you’re using the -v
flat with that volume ID. I’d probably load up a Postgres image, mount the volume where the image expects to find its data, and dump it out somewhere. Once you’ve got a database dump, you should be able to create a new instance and load in the old data with our existing fly postgres
commands.
Hope that helps, please let me know if you have more questions.