# Restore a snapshot onto a server

> Restore a snapshot onto the server it came from or onto any other server on your account.

Source: https://docs.coritan.com/snapshots/restore-a-snapshot/

In the dashboard:

- /dashboard/snapshots: https://www.coritan.com/dashboard/snapshots
- /dashboard/servers/…/snapshots: https://www.coritan.com/dashboard/servers

Restoring a snapshot writes its files onto a server. The server can be the one the snapshot came from, to roll it back, or any other server on your account, to move a world to it. Start from the account's **Snapshots** page to choose the server, or from the **Snapshots** tab of the server you want to restore onto.

## Before you begin

- The server must belong to the account that holds the snapshot. On a server someone shared with you, the Snapshots permission lets you restore that server's snapshots onto it.
- Only a snapshot with the status `Completed` can be restored.
- The snapshot must come from the same game as the server. When the server runs different software for that game, such as Fabric for a Paper world, you must allow the difference, and the plugins or mods do not carry over.
- The server must not be installing, being moved or suspended. A server runs one snapshot or restore at a time.
- A restore stops the server, and the server stays stopped until you start it.
- A snapshot holds the server's files only. The server's [databases](/managed-containers/databases/) stay as they are.

> [!WARNING]
> **Wipe the server first** is ticked by default. It deletes every file on the server before we write the snapshot's files, so you lose every change made since the snapshot was taken. [Take a snapshot](/managed-containers/snapshots/) of the server first if you might need its current files.

## Restore from the Snapshots page

1. In the [dashboard](https://www.coritan.com/dashboard/snapshots), go to **Snapshots**.
2. Open the menu at the end of the snapshot's row and select **Restore onto a server…**. It is greyed out until the snapshot is `Completed`.
3. Under **Restore onto**, choose the server. The list starts on the server the snapshot came from, marked `(source)`, while that server exists.
4. Leave **Wipe the server first** ticked to replace the server's files with the snapshot's. Clear it to write the snapshot's files over the ones already there; any file newer than the snapshot stays mixed in with the restored ones.
5. If the server runs different software for the same game, tick **Allow a different loader**.
6. Select **Wipe and restore**, or **Restore snapshot** when you cleared **Wipe the server first**.

## Restore from a server's Snapshots tab

1. In the [dashboard](https://www.coritan.com/dashboard/servers), go to **Container Apps** and open the server you want to restore onto, then its **Snapshots** tab.
2. Select **This server** for the server's own snapshots, or **Whole account** for every snapshot on your account. On **Whole account**, the **Fit** column says how each snapshot fits this server ([See which snapshots fit this server](/managed-containers/snapshots/#see-which-snapshots-fit-this-server)).
3. Open the menu at the end of the snapshot's row and select **Restore onto this server…**. It is greyed out for a snapshot from another game.
4. Check the details in the dialog. When **Fit** shows **Other loader**, tick **Allow a different loader** to go ahead.
5. Leave **Wipe the server first** ticked, or clear it, as step 4 of the other way describes.
6. Select **Wipe and restore** or **Restore snapshot**.

## Result

A message confirms the start, such as `Restore of before-1.21-update onto survival-smp started. The server is stopped while files are written.` The snapshot's status shows `Restoring` while we write the files, and `Completed` again when the restore ends.

The server stays stopped. Open its **Console** tab and select **Start**. The snapshot shows `Completed` again after a failed restore too, so check that the server starts and holds the files you expect before players join.

## Troubleshooting

When a restore cannot start, the dialog stays open and the page shows **Could not start the restore** with one of these messages:

`A snapshot or restore is already in progress on this server; wait for it to finish before you restore.`
: Wait until the other snapshot or restore of the server shows `Completed` or `Failed`, then try again.

`Cannot restore a snapshot while the server is suspended`
: A suspended server cannot take a restore. The same message names `installing` or `transferring` while the server installs or moves; wait until that finishes.

`That snapshot belongs to a different account than this server.`
: The server you chose was shared with you by someone else. Restore onto a server on your own account.

`Snapshot is restoring and cannot be restored`
: The message names the snapshot's status. Only a `Completed` snapshot can be restored, so wait for it to finish, or choose another snapshot.

A message that ends `Restore it onto a server running the same game.`
: The snapshot comes from a different game than the server. The start of the message says what differs. Restore it onto a server that runs the same game.

A message that ends `Confirm the software mismatch to restore anyway.`
: Tick **Allow a different loader** and try again. If the server's tab does not offer it, restore from the account's **Snapshots** page, where the dialog always offers it.

A message that starts `Object storage did not return a download URL`
: The storage that holds the snapshot did not answer. Try again in a few minutes.

`The node is unreachable` or `The node could not complete this request`
: The machine the server runs on did not accept the restore. The snapshot is unharmed and shows `Completed` again. Try again in a few minutes, or [contact support](/support/conversations/).

The dialog says `You have no server to restore onto.`
: [Order a server](/managed-containers/order-a-server/) first, then restore onto it. The server order page on coritan.com cannot start from a snapshot, even though the dialog says it can. [Start a new server from a snapshot](/snapshots/new-server-from-a-snapshot/) describes what you can do.

**Wipe and restore** is greyed out
: No server is chosen, the snapshot comes from another game, or **Allow a different loader** is not ticked for a snapshot that needs it.

The snapshot stays on `Restoring`
: We end a restore that has not finished after 4 hours, and the snapshot shows `Completed` again. Check the server's files, then restore again or [contact support](/support/conversations/).

The server does not start after the restore
: Read the console output. A world from a newer game version than the server runs does not load, and [The server crashed or stopped](/managed-containers/troubleshooting/#the-server-crashed-or-stopped) covers the other causes.

## Related

- [Take a server snapshot](/managed-containers/snapshots/)
- [Lock, download and delete snapshots](/snapshots/manage-snapshots/)
- [Start a new server from a snapshot](/snapshots/new-server-from-a-snapshot/)
- [Snapshots and backups compared](/snapshots/snapshots-and-backups/)

## With the API

`POST /api/v1/client/snapshots/{snapshot_uuid}/restore` starts a restore. The body names the server:

`target_server_uuid`
: Required. The UUID of the server to restore onto. It must belong to the account that holds the snapshot.

`truncate`
: `true`, the default, deletes the server's files first. `false` writes the snapshot's files over them.

`allow_mismatch`
: `true` allows a restore onto different software for the same game. The default is `false`. It never allows a different game.

```bash
curl -X POST https://api.coritan.com/api/v1/client/snapshots/$SNAPSHOT/restore \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_server_uuid": "7e3f1b2a-9c4d-4f6e-8a1b-2c3d4e5f6a7b", "truncate": true, "allow_mismatch": false}'
```

```json
{
  "message": "Restore initiated",
  "status": "restoring",
  "restore_uuid": "c2d4e6f8-1a3b-4c5d-8e9f-0a1b2c3d4e5f"
}
```

Poll `GET /api/v1/client/snapshots/{snapshot_uuid}` until `status` is `completed` again, then start the server.

A request without `target_server_uuid` answers `422`. A server on another account answers `403`, and so does a server shared with you when you lack `snapshot.restore` on it. A snapshot or server that does not exist answers `404`. The server's state, a snapshot that is not `completed` and a software mismatch answer `409` with the messages under [Troubleshooting](#troubleshooting). `503` means the storage is not available, and `502` means the server's machine did not accept the restore.

## API

- `POST /api/v1/client/snapshots/{snapshot_uuid}/restore`: Restore a snapshot onto one of this account's servers (https://docs.coritan.com/api/reference/client/container-apps/snapshots/#op-post-api-v1-client-snapshots-snapshot-uuid-restore)
