Learning paths / Operate your application / Backups and availability

Snapshots, daily schedules and restores

Reading · 7 min · Module 8, lesson 3 of 537 min left in this module

Module 8 · Backups and availabilityLesson 3 of 5

Preview. Volumes and snapshots are being fixed on the platform, so a restore doesn't bring volume data back yet. Read it through now; the steps are the ones you'll use.

Goal: Snapshot a service with a volume, put it on a daily schedule, and restore it, including into another environment.

Key idea

A snapshot captures a service at one moment: its settings and the volume mounted on it. Take one before a risky change, schedule one daily, and restore it to put the service back as it was, in the same environment or another.

Everything here is on the service's Backups tab. The console calls each snapshot a backup; they're the same thing.

Take one now

Choose Back up now. A row appears in the list marked PENDING, and turns COMPLETED when the snapshot is ready. Take one before anything you might want to undo: a migration, a bulk import, a change to how the app writes its files.

Put it on a schedule

  1. Open the schedule

    On the Backups tab, choose the settings icon (Schedule settings).

    You should seeA Backup schedule dialog.

  2. Turn on automatic backups

    Switch on Automatic backups, then pick Daily at 2 AM from Quick presets, or type a Cron expression.

    You should seeBackups run on the schedule below.

  3. Save

    Choose Save.

    You should seeThe tab shows the schedule above the list.

A cron expression has five fields: minute, hour, day of the month, month, day of the week, in UTC. 0 2 * * * means 02:00 UTC every day. Pick a quiet hour for your users, which in UTC may not be 2 AM. A daily schedule means you can lose up to a day of changes (lesson 6.8.1); if that's too much, choose Every hour.

Restore

On a COMPLETED row, choose Restore. The Restore backup dialog warns that the service's settings will be restored and the service redeployed. Pick an option under Restore to:

Restore toWhere it landsUse it to
Same service and environmentReplaces the service you're onUndo a bad change
Same service, different environmentThis service, in another environment of this projectCopy production data into staging to reproduce a bug
New serviceA new service, in the project and environment you chooseLook at old data without touching the live service

Choose Restore. The service redeploys; the history icon (View logs) opens Restore logs, which show its progress.

A snapshot can't be restored in its first two minutes; wait, then try again.

What a snapshot doesn't hold

It covers the service and its SphereStor volume. A database at your provider isn't in it: restore that with the provider's own backups (lesson 6.8.1), to the same moment if the two must agree. Files kept on the spherelet's own filesystem aren't in it either; they were never meant to last.

Check yourself

A bad import filled your volume with wrong data an hour ago. Last night's snapshot is COMPLETED. Which option do you pick in Restore to?

In the docs