With the Snaplet CLI installed and configured, and having gone through the Snaplet Cloud onboarding experience, at this point you should have a snapshot ready to restore into your target development database.
If you didn't create a snapshot with Snaplet Cloud, you'll need to do so, or create a snapshot manually. More advanced users can also capture a snapshot from inside the CLI. Go to our capture page for more info on how to do this.
snaplet snapshot restore to download the latest snapshot from a project and restore it into your target database.
That's it! In a few minutes you captured, transformed, shared and restored a snapshot.
What's next? If you haven't already, connect Snaplet to your own database. You can self-host Snaplet in your own trusted infrastructure as well.
You can also restore your snapshot to your database with more granularity, choosing to not drop the database, or to not restore the schemas or data.
Snapshot restoration happens in three key steps:
- The target database is dropped.
- The target database schemas are restored from the snapshot.
- The target database data is restored from the snapshot.
It's possible to omit any of the steps above during snapshot restoration by using an opt-out flag. For instance, when restoring to a Supabase database, it's necessary to skip resetting the database itself.
The follow opt-out flags can be used to omit steps in the restoration process.
- Don't drop the target database :
- Don't restore the schemas on the target database:
- Don't restore the data on the target database:
Opt-out flags are appended to the
snaplet snapshot restore command:
If you're having any issues restoring your snapshot to your target database, feel free to join us on Discord (opens in a new tab) to troubleshoot your issue.