> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/compute/kvm-virtual-machines/how-tos/restore-virtual-machines.md).

# Restore virtual machines

VMs are restored by creating a new VM from a backup.

***

## Restore a virtual machine using the control panel

It is not possible to restore an existing virtual machine (VM) from a backup. Instead, you create a new VM from a backup. This approach is equivalent to restoring the VM but allows the current VM to continue running until the new one is fully set up. The new VM is created without any assigned IP addresses.

Once you are fully satisfied with the newly restored VM, you can release the IP addresses from the old VM and assign them to the new one. The new VM will then be identical to the old one.

{% tabs %}
{% tab title="Restore from an existing VM" %}
To restore and create a new VM from a backup of an existing VM, start by navigating to the VM's overview.

Select **Virtual machines** from the left-hand menu under **Compute**, then click on the VM to be restored. After that, click on the **Backups** tab.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FrzxHZUyOX90TRhV6QYSD%2Fkvm-backups-tab.png?alt=media&amp;token=28414295-f7f7-40d1-a1dc-52f5298fa93f" alt=""><figcaption></figcaption></figure></div>

Select the backup from which you want to restore the VM in the following dialog box. Here, we choose the most recent one. Click the three dots to the right of the backup and select **Restore**.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fy7J2SO9YrSvoTCAV0kGZ%2Fkvm-restore-server-button.png?alt=media&amp;token=dd303ffa-ef9b-497b-84fe-f9387422ad5f" alt=""><figcaption></figcaption></figure></div>

Select the data center where you want to restore the server. Currently, you can choose between Falkenberg, Stockholm, and Oulu. Here, you can also view the cost of the restored VM. Click **Restore** after selecting the data center.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FkSKE9Ou0n4zNFRagUnrO%2Fkvm-restore-server.png?alt=media&amp;token=26427848-ede1-4ad1-a8b0-93878db7acf1" alt=""><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Restore from a deleted VM" %}
If the VM has been deleted, you can still restore it by creating a new VM from one of its backups, provided at least one remains within the retention window. Backups of a deleted VM are purged at the end of the retention period. For example, if you have daily backups with seven days of retention, the last backup will be purged after seven days (it's a rolling schedule).

To create a new VM from a backup, navigate to **Compute → Virtual machines**, then click **Create**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fbq1CKQpw7xMa6lSuwVsi%2Fcreate-new-kvm-vm-from-backup1.png?alt=media&amp;token=214375e9-64be-4237-863f-6c48b6785cd5" alt=""><figcaption></figcaption></figure>

Switch to the **Backup** tab at the top. Click the three dots to the right of the deleted VM you would like to restore—deleted VMs are marked with a *Deleted* tag. Then, click **Restore**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FXO1azx3U0RQcgN12c4uL%2Fcreate-new-kvm-vm-from-backup2.png?alt=media&amp;token=59289b8b-2abe-41c3-b58b-6f462c042537" alt=""><figcaption></figcaption></figure>

Using the drop-down menu, choose the data center where you would like to restore the VM. Currently, you can choose between Falkenberg, Stockholm, and Oulu. Finally, click **Restore**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2F875uxmBU3EDY8620bO74%2Fcreate-new-kvm-vm-from-backup3.png?alt=media&amp;token=1a1c7fd4-0113-42cc-9460-b989642797a8" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Once the VM is restored, it appears in the VM overview. It appears and functions identically to any other VM, but is powered off and lacks assigned IP addresses. It is also named after the original VM with the suffix `restored`. The description of the server indicates from which snapshot the VM was created; for example, `Restored from snapshot taken at: 2025-05-27-17-28-UTC`.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FgpkKzO1wxXP3V9GYnHM5%2Fkvm-restored-server.png?alt=media&amp;token=924f67be-d5d1-4d82-9a7c-288bd7f5ca01" alt=""><figcaption></figcaption></figure></div>

Whether the IP addresses are still assigned to the old VM, were retained from a deleted VM, or have been lost, follow the respective guide for your situation below.

{% tabs %}
{% tab title="IP adr. assigned to old VM" %}
If you need to change the restored VM before transferring the IP addresses from the old VM, you can start it and log in via the [console](/products/compute/kvm-virtual-machines/how-tos/connect-to-the-vm-console.md).

The next step is to release the IP addresses from the old VM and assign them to the new one. You accomplish this by navigating to the overview of the old VM in the control panel, located under **Virtual machines** in the left-hand menu, and then clicking on the specific VM.

Locate the **IP Addresses** section and click the red crosses next to the IP addresses you wish to delete from the virtual machine. It is crucial to ensure that **Keep IP** is checked. Once you confirm that **Keep IP** is selected, click the **Confirm delete** button. The IP address is removed from the server but remains available in the [project](/platform/control-panel/projects.md).

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FIdCXlx8ZIP0OAr6XBf8Z%2Fkvm-restore-server-keep-ip.png?alt=media&amp;token=ba759f30-9dbf-47de-94fa-6f02ce608f74" alt=""><figcaption></figcaption></figure></div>

Next, navigate to the newly restored VM under **Virtual machines** in the left-hand menu. Locate the **IP Addresses** section, then click the **+ Add IPv4** and **+ Add IPv6** buttons.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FKwVZPWwm9ii1JxMjlgwC%2Fkvm-restore-server-add-ip.png?alt=media&amp;token=d6760c94-903e-40aa-b608-c4d89a44671d" alt=""><figcaption></figcaption></figure></div>

You can now locate the old VM's IP addresses under the **Reserved IP Addresses** section. In the example below, we are viewing the IPv6 Addresses. Select the IP addresses to assign to the restored VM. The selected IP addresses are highlighted in bold and marked with a checkmark on the right. Once you have chosen the appropriate IP addresses, click **Add Selected**.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fj3vOdSGyZefPw7LHxw3M%2Fkvm-restore-server-add-reserved-ip.png?alt=media&amp;token=29716cac-09f1-478e-87fd-d5081bb2665a" alt="" width="563"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="IP adr. kept from deleted VM" %}
If you have deleted the old VM but kept the IP addresses, you can simply assign them to your restored VM.

Navigate to the newly restored VM under **Virtual machines** in the left-hand menu. Locate the **IP Addresses** section, then click the **+ Add IPv4** and **+ Add IPv6** buttons.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fqogi2kC8VWBjmrAeC3nz%2Fkvm-restore-server-add-ip.png?alt=media&amp;token=4895027a-ce26-45b8-bfaa-3e00a995d63c" alt=""><figcaption></figcaption></figure>

You can now locate the old VM's IP addresses under the **Reserved IP Addresses** section. In the example below, we are viewing the IPv6 Addresses. Select the IP addresses to assign to the restored VM. The selected IP addresses are highlighted in bold and marked with a checkmark on the right. Once you have chosen the appropriate IP addresses, click **Add Selected**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FVbTuT9wmNtKMPGSqpo5B%2Fkvm-restore-server-add-reserved-ip.png?alt=media&amp;token=16590666-f9fb-4aa9-a334-3829f6985992" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="New IP adr. neccessary" %}
If you have deleted the old IP addresses along with the VM, you need to assign new ones to the restored VM.

Navigate to the newly restored VM under **Virtual machines** in the left-hand menu. Locate the **IP Addresses** section, then click the **+ Add IPv4** and/or **+ Add IPv6** buttons.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fqogi2kC8VWBjmrAeC3nz%2Fkvm-restore-server-add-ip.png?alt=media&amp;token=4895027a-ce26-45b8-bfaa-3e00a995d63c" alt=""><figcaption></figcaption></figure>

Select an available IP address and click **Add selected**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Ft5SSD22wvW7lzNwTdpIX%2Fadd-available-ipv4-address.png?alt=media&amp;token=f198e647-4260-4cd5-ad5b-490594aafb5c" alt=""><figcaption></figcaption></figure>

If your old VM only had one public IPv4 and/or one public IPv6 address, no further configuration is necessary. The VM will acquire the new IP addresses via DHCP.

However, if your old VM had several public IP addresses, DHCP is no longer active in the VM. In that case, you need to log in to the restored VM using [the console](/products/compute/kvm-virtual-machines/how-tos/connect-to-the-vm-console.md) and [manually assign the new IP address](/products/compute/kvm-virtual-machines/how-tos/manage-virtual-machines.md#add-the-ip-addresses-in-the-vms-operating-system) (or addresses). Remember that you also need to [look up the gateway and netmask](/products/compute/kvm-virtual-machines/how-tos/manage-virtual-machines.md#locate-the-gateway-and-the-netmask) of the new IP address(es).
{% endtab %}
{% endtabs %}

Now, you can start the VM. Scroll to the top of the server page, click on **Actions**, and then select **Power on**.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FtX2BiVjSEvPtBH9jhq8k%2Fkvm-restore-server-power-on.png?alt=media&amp;token=52088974-b2ae-4b24-9fba-e340bee37aa9" alt=""><figcaption></figcaption></figure></div>

The VM is now fully restored to the state it was in when the backup was taken. It even has the same IP addresses as the old VM, assuming you chose to assign the old IP addresses. You can now log in  just as before, using SSH or Remote Desktop.

## Restore a virtual machine using the API

Use the [server/listbackups](https://github.com/GleSYS/API-docs/wiki/API-Documentation#serverlistbackups) endpoint to list the currently available backups for the VM. Then, to create a new VM from a backup, use the [server/createfrombackup](https://github.com/GleSYS/API-docs/wiki/API-Documentation#servercreatefrombackup) endpoint. See [Platform → API](/platform/control-panel/api.md) on how to use the API.
