Jump toUpdate content
Migrating Instances - GP1 to PRO2
This page explains how to migrate from a GP1 Instance with local storage to a PRO2 Instance with Block Storage using the Scaleway APIs and the Scaleway CLI.
- The following procedure also applies when migrating any Instance with local storage to any Instance with Block Storage.
To migrate from a source Instance with local storage to a destination Instance with Block Storage we will:
- create a backup of the source Instance, including unified snapshots of all the source Instance’s volumes,
- create the destination Instance from the backup image
Local and block snapshots have different formats. To support the migration from one to the other, we use unified snapshots. Unified snapshots can be created from either a local or block volume and, in turn, used to create either a local or block volume.
- You have a Scaleway account
- You have configured your API keys
- You have created a General Purpose Instance
- You have installed and configured the Scaleway CLI (version 2.5.3 or later)
Migrating from GP1 to PRO2 via the API
Get the information of your source Instance. You will need data like the Instance’s and the volumes’ UUID in the next steps.
curl --location --request GET 'https://api.scaleway.com/instance/v1/zones/'$ZONE'/servers/'$GP1_INSTANCE_UUID'' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: '$SCW_SECRET_KEY''Response:
{
"server": {
"id": "4295c408-aaad-456a-95a0-7f5f6c2f2354",
"name": "gp1-test",
"arch": "x86_64",
"commercial_type": "GP1-S",
(...)
"volumes": {
"0": {
"boot": true,
"id": "$VOLUME0_UUID",
(...)
"volume_type": "l_ssd",
(...)
},
"1": {
"boot": false,
"id": "$VOLUME1_UUID",
(...)
"volume_type": "b_ssd",
(...)
},
"tags": [],
"state": "running",
(...)
}Create a backup of the Instance.
Make sure that you:
- Replace
$VOLUME0_UUID
,$VOLUME1_UUID
, and so forth with volumes’ UUIDs that you recovered in the first step of this tutorial. - Specify
unified
as the volume type of the snapshots embedded in the backup.
curl --location --request POST 'https://api.scaleway.com/instance/v1/zones/'$ZONE'/servers/'$GP1_INSTANCE_UUID'/action/' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: '$SCW_SECRET_KEY'' \
--data-raw '{
"action": "backup",
"name": "'$BACKUP_NAME'",
"volumes": {
"'$VOLUME0_UUID'": {
"volume_type": "unified"
},
"'$VOLUME1_UUID'": {
"volume_type": "unified"
}
}
}'Response:
{
"task": {
"id": "400f529a-faf9-4171-bcba-172118713d15",
"description": "server_backup",
"status": "pending",
"href_from": "/servers/4295c408-aaad-456a-95a0-7f5f6c2f2354/action",
"href_result": "/images/34d12fd2-6792-4dcb-81d0-b3dd1a3ddc29",
"started_at": "2022-05-11T10:43:40.777057+00:00",
"terminated_at": null
}
}Note:You can find the GP1 backup’s UUID from the
href_result
task output. It will be used in step 4.- Replace
Check the state of the backup to make sure it is complete.
curl --location --request GET 'https://api.scaleway.com/instance/v1/zones/'$ZONE'/images?name='$BACKUP_NAME'' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: '$SCW_SECRET_KEY''Response:
{
"images": [
{
(...)
"name": "gp1-backup",
(...)
"state": "available",
(...)Create the target Instance from the backup.
curl --location --request POST 'https://api.scaleway.com/instance/v1/zones/'$ZONE'/servers/' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: '$SCW_SECRET_KEY'' \
--data-raw '{
"name": "pro2-test",
"commercial_type": "PRO2-S",
"project": "'$PROJECT_UUID'",
"image":"'$GP1_BACKUP_UUID'",
"dynamic_ip_required": true
}'Response:
"server": {
"id": "998b88d1-1d71-4a0a-8432-5965222d14a1",
"name": "pro2-test",
"arch": "x86_64",
"commercial_type": "PRO2-S",
(...)
"state": "stopped",
(...)
}Start the target Instance.
curl --location --request POST 'https://api.scaleway.com/instance/v1/zones/'$ZONE'/servers/'$PRO2_INSTANCE_UUID'/action/' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: '$SCW_SECRET_KEY'' \
--data-raw '{
"action": "poweron"
}'Response:
{
"task": {
"id": "d7902607-2fe0-45f7-874f-72201e2654d4",
"description": "server_batch_poweron",
"status": "pending",
"href_from": "/servers/998b88d1-1d71-4a0a-8432-5965222d14a1/action",
"href_result": "/servers/998b88d1-1d71-4a0a-8432-5965222d14a1",
"started_at": "2022-05-11T10:52:23.222827+00:00",
"terminated_at": null
}
}Check the status of the Instance.
curl --location --request GET 'https://api.scaleway.com/instance/v1/zones/$ZONE/servers/'$PRO2_INSTANCE_UUID'' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: '$SCW_SECRET_KEY''Response:
{
"server": {
"id": "998b88d1-1d71-4a0a-8432-5965222d14a1",
"name": "pro2-test",
(...)
"state": "running",
(...)
}
}
Migrating from GP1 to PRO2 via the CLI
Open a terminal and type the following command, to create a GP1 Instance:
scw instance server create type=GP1-S zone=fr-par-2
You will see an output like the following. The Instance’s ID will be required for the next step.
ID 123a12ab-12a1-1a12-123a-a1bc1234a123
Name cli-instance-test
Organization 0a123456-1a2b-12a3-a123-1abc0123d456
Project 0b123456-1b2b-12b3-b123-1bca0123d456
AllowedActions.0 poweron
AllowedActions.1 backup
CommercialType GP1-S
CreationDate 1 second ago
DynamicIPRequired false
EnableIPv6 false
Hostname cli-instance-test
Image.ID 0a123456-1a2b-12a3-a123-1abc0123d456
Image.Name Ubuntu 20.04 Focal Fossa
Image.Arch x86_64
Image.CreationDate 5 months ago
Image.ModificationDate 5 months ago
Image.ExtraVolumes 0
Image.FromServer -
Image.Organization 0a123456-1a2b-12a3-a123-1abc0123d456
Image.Public true
Image.RootVolume 0a123456-1a2b-12a3-a123-1abc0123d456
Image.State available
Image.Project 0a123456-1a2b-12a3-a123-1abc0123d456
Image.Zone fr-par-2
Protected false
PublicIP.ID 0a123456-1a2b-12a3-a123-1abc0123d456
PublicIP.Address 00.000.000.000
PublicIP.Dynamic false
ModificationDate 1 second ago
State archived
Bootscript x86_64 mainline 4.4.230 rev1
BootType local
Volumes.0.ID 0a123456-1a2b-12a3-a123-1abc0123d456
Volumes.0.Name ubuntu_20.04_focal_fossa:volume-0
Volumes.0.ExportURI -
Volumes.0.Organization 0a123456-1a2b-12a3-a123-1abc0123d456
Volumes.0.Server.ID 0a123456-1a2b-12a3-a123-1abc0123d456
Volumes.0.Server.Name cli-instance-test
Volumes.0.Size 300 GB
Volumes.0.VolumeType l_ssd
Volumes.0.CreationDate 1 second ago
Volumes.0.ModificationDate 1 second ago
Volumes.0.State available
Volumes.0.Project 0b123456-1b2b-12b3-b123-1bca0123d456
Volumes.0.Boot false
Volumes.0.Zone fr-par-2
SecurityGroup.ID 0b123456-1b2b-12b3-b123-1bca0123d456
SecurityGroup.Name Default security group
StateDetail -
Arch x86_64
Zone fr-par-2Type the following command to back up your Instance:
scw instance server backup 123a12ab-12a1-1a12-123a-a1bc1234a123 zone=fr-par-2 unified=true
Make sure that you specify
unified=true
as the volume type of the snapshots embedded in the backup.
You will see an output like the following. The Image.ID
will be required for the next step.
Image.ID 0b123456-1b2b-12b3-b123-1bca0123d456
Image.Name cli-backup-image
Image.Arch x86_64
Image.CreationDate now
Image.ModificationDate now
Image.DefaultBootscript x86_64 mainline 4.4.230 rev1
Image.ExtraVolumes 0
Image.FromServer 012n23ba-25z8-7g97-530a-m6ol1941f001
Image.Organization 0b123456-1b2b-12b3-b123-1bca0123d456
Image.Public false
Image.RootVolume 012n23ba-25z8-7g97-530a-m6ol1941f001
Image.State creating
Image.Project 012n23ba-25z8-7g97-530a-m6ol1941f001
Image.Zone fr-par-2
Type the following command to create a PRO2 Instance from the image created by the backup:
scw instance server create image=0b123456-1b2b-12b3-b123-1bca0123d456 zone=fr-par-2 type=PRO2-S
You will see an output like the following:
ID 2566b1c7-8b90-5d67-9876-34f4a9f2c3d1
Name cli-srv-noisy-herschel
Organization 0a123456-1a2b-12a3-a123-1abc0123d456
Project 0a123456-1a2b-12a3-a123-1abc0123d456
AllowedActions.0 poweron
AllowedActions.1 backup
CommercialType PRO2-S
CreationDate now
DynamicIPRequired false
EnableIPv6 false
Hostname cli-srv-noisy-herschel
Image.ID 0b123456-1b2b-12b3-b123-1bca0123d456
Image.Name cli-backup-nervous-antonelli
Image.Arch x86_64
Image.CreationDate 5 minutes ago
Image.ModificationDate 5 minutes ago
Image.DefaultBootscript x86_64 mainline 4.4.230 rev1
Image.ExtraVolumes 0
Image.FromServer 027e84ab-12a8-4m07-993c-c3da1941f883
Image.Organization 0c518794-9b2f-38g9-a910-9fdf0634b590
Image.Public false
Image.RootVolume ah456750-fdc1-4bde-b15e-7d3e1hhhgg74
Image.State available
Image.Project 0c514155-7n6s-41a2-a900-9fdf4532b365
Image.Zone fr-par-2
Protected false
PublicIP.ID 48456zs3-7e85-4a94-bb79-cbccbf03kl0c
PublicIP.Address 00.000.000.000
PublicIP.Dynamic false
ModificationDate now
State archived
Bootscript x86_64 mainline 4.4.230 rev1
BootType local
Volumes.0.ID 760982f8-c321-4cd2-b62c-bc31ef43fccm
Volumes.0.Name cli-backup-nervous-antonelli_snap_0
Volumes.0.ExportURI -
Volumes.0.Organization 0c908137-9d5c-41a2-a900-9fdf0485b365
Volumes.0.Server.ID 3921b1b6-8b88-4c75-7800-76e4d9f2c4d6
Volumes.0.Server.Name cli-srv-noisy-herschel
Volumes.0.Size 300 GB
Volumes.0.VolumeType b_ssd
Volumes.0.CreationDate now
Volumes.0.ModificationDate now
Volumes.0.State available
Volumes.0.Project 0c769807-9a1e-42a1-o900-9fdf0591b365
Volumes.0.Boot false
Volumes.0.Zone fr-par-2
SecurityGroup.ID 4917e509-be67-9c12-b42f-bead79081o00
SecurityGroup.Name Default security group
StateDetail -
Arch x86_64
Zone fr-par-2Your PRO2 Instance is created and displays in the Scaleway console in the Instances dashboard.