Snapshots and copies
A snapshot records a Computer's disk at a point in time. It can be restored to that Computer or copied to a new one.
On this page
Snapshots contain files and installed software. They stay on the same server as the Computer and can be lost with it. Heaven keeps separate off-host backups of the working disk.
Creating a snapshot
#Create a snapshot before an upgrade or configuration change:
heaven snapshot create my-site before-upgrade
heaven snapshot view my-site before-upgradeWait for the snapshot to reach ready before making the change.
A running Computer can continue operating during capture. The snapshot records whether the disk was stopped, flushed or unflushed. An unflushed snapshot has the consistency of a disk after a power cut. Prepare databases according to their backup procedures before capture.
Snapshots expire after seven days by default. Set retention when creating or editing a snapshot.
Restoring a snapshot
#Restoring replaces the working disk and restarts the Computer. Changes made since the snapshot are removed from that disk. Heaven first saves the current disk as a before-rollback-… snapshot, retained for seven days by default.
The pool must be running. Resume a paused Computer before restoring it:
heaven snapshot restore my-site before-upgrade
heaven view my-siteTo undo the restore, use the before-rollback-… snapshot named in the result.
The Computer retains its name, domains, sharing and tags. Running processes start afresh.
Creating a copy
#A copy creates a Computer with its own disk and identity in a pool on the same server. Copy a saved disk into web:
heaven create my-site-test --pool web --copy my-site --snapshot before-upgrade --wait=60s
heaven view my-site-testYou need permission to copy the snapshot and create in the destination pool. The copy starts a fresh boot; setup scripts are not rerun.
The saved files include application credentials and configuration. The website port is copied, and public access can be copied when your permissions allow it. Review the copy's Sharing and application configuration before using it. Shares, custom domains and public ports are not inherited.
Storage and retention
#Snapshots count toward the pool's storage. Data remains allocated while a snapshot or copy uses it, even after the original file or snapshot is deleted.
The Snapshots tab shows sizes, expiry and dependent copies. Deleting a Computer removes its snapshots. Existing copies remain independent Computers.
Pool snapshots
#A pool snapshot groups snapshots of its Computers under one name. Disks are captured sequentially. Coordinate application writes before capturing a distributed system.
Organization managers can create and restore pool snapshots. A restore applies to the captured Computers and leaves later Computers in place. Each Computer has its own result.
Sharing snapshots
#Use a pool snapshot to give another account a copy of an environment, such as a prepared test setup. The organization's billing owner, admins and members granted the share command can share a pool snapshot with people outside the organization who already have a Heaven account. Heaven emails the recipients. A share covers the entire pool snapshot, so use a pool with only the Computer you intend to share when you want to share a single saved disk.
Recipients sign in as themselves and list shares with heaven pool snapshot view --shared true. They can create a Computer from one saved disk by specifying their own pool, or create a pool from the whole snapshot. The destination must have capacity on the same server as the source. The share grants copy access to the saved disks only. Check the saved files for credentials before sharing.
Removing the share or letting the snapshot expire ends access for new copies. Computers recipients already copied stay theirs.
Backups
#Heaven backs up Computer disks about once an hour when they have new writes. These backups are encrypted and stored separately from the Computer's server. They cover the working disk, so a backup restore can't recover saved snapshots.
Heaven restores the selected backup into a new Computer with the files, installed software and configuration on the disk at that point. The restored disk omits changes made after the backup. The Computer boots afresh, so previous processes don't resume. Set up sharing, custom domains and public ports on the new Computer as needed.
To request a restore, email support@heaven.dev with the Computer's name, its organization and the date and time you want to restore to. If you deleted the Computer, support can restore it from a backup for 7 days after the deletion. delete shows whether each Computer has a backup and its deadline.