CorefinityCorefinityDocs
Open the Control PanelControl Panel
Recipes · 4 of 8

Take a snapshot and keep it

Take a snapshot of a site before a change, wait until it is ready and keep it from expiring.

On this page

A snapshot copies one environment's files and database. This recipe takes one of the site harbourandfinch.example.com and keeps it.

Before you start

  • A token with the read and write scopes.
  • Every step needs two-factor enrolment when your company requires it.
  • No step waits for a maintenance window.
  1. Take the snapshot

    note is optional and holds up to 140 characters.

    Terminal
    curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/snapshots \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{"note": "Before the theme change"}'

    The answer is 201 with the snapshot. Note its id; its status is pending or creating.

  2. Wait until it is ready

    A snapshot is read on its own endpoint, not on the operations endpoint. Read it every few seconds until status is ready or failed.

    Terminal
    curl https://manage.corefinity.com/api/corestack/snapshots/3301 \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
  3. Keep it

    A kept snapshot stays until you stop keeping it. The answer is 200 with the snapshot as it is now.

    Terminal
    curl -X PATCH https://manage.corefinity.com/api/corestack/snapshots/3301 \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{"protected": true}'
  4. Check the list

    The site's list shows the snapshot with protected: true, and settings.manual_remaining_this_hour shows how many more you can take this hour.

    Terminal
    curl https://manage.corefinity.com/api/corestack/sites/1042/snapshots \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"

If it is refused

StatusreasonWhat to do
409in_flightA snapshot is already being taken. Wait for it
409restoringA restore is running. Wait for it to finish
429manual_cap20 one-off snapshots were taken of this site in the last hour. Try again later
429google_capThe hourly limit of all snapshots of the site was reached. Try again later
422disabledSnapshots are not enabled where the site runs
422stateThe snapshot cannot be kept yet: it is not ready, or its size is not known. Do step 2 first
422keep_cap_reachedKept snapshots already use your whole keep allowance. Stop keeping another snapshot first

To stop keeping a snapshot, send {"protected": false}. Deleting one needs the destructive scope.

Was this helpful?
Open in ClaudeOpen in ChatGPT