You can now create named snapshots of a Vercel Drive. Each one is a read-only copy of the drive's contents at the moment you create it. Later writes to the drive don't change it. You can mount the snapshot in multiple sandboxes at once, or fork it into a new writable drive to continue from that point.
Until now, a drive snapshot lasted only as long as the sandbox that mounted it. drive.snapshot() still works that way.
With Vercel CLI 68.3.0 or later, run:
vercel drives snapshot workspace-cache baselinevercel drives snapshots list workspace-cachevercel drives snapshots fork baseline workspace-cache-restored --drive workspace-cacheCreate, list, and fork named snapshots with the Vercel CLI.
Update @vercel/drives and @vercel/sandbox for TypeScript, or vercel-drives and vercel-sandbox for Python, then run:
import { Drive } from '@vercel/drives';import { Sandbox } from '@vercel/sandbox';
const drive = await Drive.get({ name: 'workspace-cache' });const snapshot = await drive.snapshot({ name: 'baseline' });
const sandbox = await Sandbox.create({ region: snapshot.region, mounts: { '/data': snapshot },});
const restored = await snapshot.fork({ name: 'workspace-cache-restored' });Create, mount, and fork a named snapshot with the TypeScript SDK.
Each named snapshot is billed as drive storage for its used size until you delete it. You can also view and delete a drive's named snapshots in the Vercel dashboard.
Named snapshots are separate from Sandbox snapshots, which save a sandbox's whole filesystem. See when to use drives vs Sandbox snapshots.
Named snapshots are available on Hobby, Pro, and Enterprise plans. Learn more in the Drives documentation.