Skip to content

backups

The backups commands manage the backups Kinsta keeps of an environment, and the downloadable archives you can take off Kinsta.

Terminal window
kinstactl backups list my-site --env live
kinstactl backups create my-site --env live --tag "before plugin update"
kinstactl backups restore my-site 123456789 --env live --notify [email protected]

Backups belong to an environment. Without --env, the site’s only environment is used; see Sites and environments. Creating, restoring and deleting wait for Kinsta to finish by default, and accept --no-wait, --timeout <minutes> and --dry-run; see operations.

List the backups of an environment, newest first.

Terminal window
kinstactl backups list my-site --env staging --type manual
kinstactl backups list [site] [options]

List the backups of an environment, newest first

Arguments

ArgumentDescription
sitesite name or ID

Options

OptionDescription
--env <name>environment (default: the only one)
--type <type>only this backup type, e.g. manual, scheduled or system

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /sites/environments/{env_id}/backups

The table shows the backup ID, its type, the note and when it was created. You need the ID for backups restore and backups delete. --type keeps only one kind of backup, for example manual, scheduled or system.

Create a manual backup.

Terminal window
kinstactl backups create my-site --env live --tag "before plugin update"
kinstactl backups create [site] [options]

Create a manual backup

Arguments

ArgumentDescription
sitesite name or ID

Options

OptionDescription
--env <name>environment (default: the only one)
--tag <text>label for the backup
--dry-runprint the resolved target and request; change nothing
--no-waitreturn the operation ID instead of waiting
--timeout <minutes>give up waiting after this many minutes (default 30)

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: POST /sites/environments/{env_id}/manual-backups

Take a manual backup before a risky change such as a plugin update or an env push. --tag labels the backup so you recognise it later.

Restore a backup, replacing the environment.

Terminal window
kinstactl backups restore my-site 123456789 --notify [email protected]
kinstactl backups restore <site> <backup-id> [options]

Restore a backup, replacing the environment

Arguments

ArgumentDescription
sitesite name or ID
backup-idbackup ID, see: backups list

Options

OptionDescription
--env <name>environment to restore to (default: the only one)
--from-env <environment>environment the backup was taken on (default: --env)
--notify <email>company user to notify when the restore finishes
--dry-runprint the resolved target and request; change nothing
--no-waitreturn the operation ID instead of waiting
--timeout <minutes>give up waiting after this many minutes (default 30)
--yesskip the confirmation prompt

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /sites/environments/{env_id}/backups, GET /company/{id}/users, POST /sites/environments/{target_env_id}/backups/restore

Restoring replaces the content of the environment with the backup, so the command asks for confirmation. On a terminal you answer a prompt; in a script pass --notify <email> and --yes. Without --notify a script fails with USAGE (there is no user to notify), and without --yes it fails with CONFIRMATION_REQUIRED (exit code 5). --notify takes the email of a company user, who is notified when the restore finishes.

By default the backup is restored onto the environment it was taken on. With --from-env you restore a backup taken on another environment of the same site onto --env, for example a staging backup onto live:

Terminal window
kinstactl backups restore my-site 123456789 --from-env staging --env live --notify [email protected]

The backup ID is looked up in --from-env, and the confirmation names both environments, so you can see that the content of live is about to be replaced by a backup from staging.

Delete a backup.

Terminal window
kinstactl backups delete my-site 123456789 --env staging --yes
kinstactl backups delete <site> <backup-id> [options]

Delete a backup

Arguments

ArgumentDescription
sitesite name or ID
backup-idbackup ID, see: backups list

Options

OptionDescription
--env <name>environment (default: the only one)
--dry-runprint the resolved target and request; change nothing
--no-waitreturn the operation ID instead of waiting
--timeout <minutes>give up waiting after this many minutes (default 30)
--yesskip the confirmation prompt

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /sites/environments/{env_id}/backups, DELETE /sites/environments/backups/{backup_id}

The backup is looked up first, and the confirmation shows its ID and creation time. On a terminal you answer a prompt; in a script pass --yes.

List the downloadable backup archives of an environment.

Terminal window
kinstactl backups downloadable list my-site --env live
kinstactl backups downloadable list [site] [options]

List the downloadable backup archives of an environment

Arguments

ArgumentDescription
sitesite name, display name or ID

Options

OptionDescription
--env <environment>environment name or ID

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /sites, GET /sites/environments/{env_id}/downloadable-backups

A downloadable backup is an archive you can download from Kinsta, as opposed to the backups above, which you can only restore. The table shows when each archive was created and when it expires.

Create a downloadable backup archive.

Terminal window
kinstactl backups downloadable create my-site --env live
kinstactl backups downloadable create [site] [options]

Create a downloadable backup archive

Arguments

ArgumentDescription
sitesite name, display name or ID

Options

OptionDescription
--env <environment>environment name or ID
--dry-runprint the resolved target and request; change nothing
--no-waitreturn the operation ID instead of waiting
--timeout <minutes>give up waiting after this many minutes (default 30)

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /sites, POST /sites/environments/{env_id}/downloadable-backups, GET /sites/environments/{env_id}/downloadable-backups

When the archive is ready, the command prints its download link. With --no-wait it returns the operation ID instead, and you collect the link later with backups downloadable list. Kinsta limits how often you can create one; check that with backups downloadable quota first.

Check whether a new downloadable backup can be created.

Terminal window
kinstactl backups downloadable quota my-site --env live
kinstactl backups downloadable quota [site] [options]

Check whether a new downloadable backup can be created

Arguments

ArgumentDescription
sitesite name, display name or ID

Options

OptionDescription
--env <environment>environment name or ID

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /sites, GET /sites/environments/{env_id}/next-downloadable-backup-available

The command prints available when you can create a new archive now, and otherwise when the next one becomes available.