how to attach a volume snapshot to a vm?

I accidently deleted my db in my volumes, so I want to use its latest snapshot to restore the data. I created a new volume based on this snapshot but I cant attach it to a VM. How do I do it? should I delete the VMs with the outdated data and create new VMs that will be automatically attached to the snapshot? please help :slight_smile:

Update: Worked! just cloned the vm and attached the snapshot to it, with:

flyctl machines clone <existing-machine-id> --attach-volume <volume-id>

Hi… Which database is this? There are several in common use on Fly.io, and they would basically all have different recommendations…

Disclaimer: I haven’t tried this, but before you delete the VM with the outdated data, try cloning it and pass either --attach-volume or --from-snapshot on the fly machine clone · Fly Docs command.

I’m using sqlite

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.