Jump toUpdate content
Migrating Instances - DEV1/GP1 to PLAY2/PRO2
This page explains how to migrate from a DEV1/GP1 Instance with local storage to a PLAY2/PRO2 Instance with Block Storage using the Scaleway APIs and the Scaleway CLI.
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- 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 an image of the source Instance, including unified snapshots of all the source Instance’s volumes,
- create the destination Instance from the 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 DEV1/GP1 to PLAY2/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 DEV1/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 DEV1/GP1 to PLAY2/PRO2 via the CLI
-
Open a terminal and type the following command, to create a DEV1/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-a1bc1234a123Name cli-instance-testOrganization 0a123456-1a2b-12a3-a123-1abc0123d456Project 0b123456-1b2b-12b3-b123-1bca0123d456AllowedActions.0 poweronAllowedActions.1 backupCommercialType GP1-SCreationDate 1 second agoDynamicIPRequired falseEnableIPv6 falseHostname cli-instance-testImage.ID 0a123456-1a2b-12a3-a123-1abc0123d456Image.Name Ubuntu 20.04 Focal FossaImage.Arch x86_64Image.CreationDate 5 months agoImage.ModificationDate 5 months agoImage.ExtraVolumes 0Image.FromServer -Image.Organization 0a123456-1a2b-12a3-a123-1abc0123d456Image.Public trueImage.RootVolume 0a123456-1a2b-12a3-a123-1abc0123d456Image.State availableImage.Project 0a123456-1a2b-12a3-a123-1abc0123d456Image.Zone fr-par-2Protected falsePublicIP.ID 0a123456-1a2b-12a3-a123-1abc0123d456PublicIP.Address 00.000.000.000PublicIP.Dynamic falseModificationDate 1 second agoState archivedBootscript x86_64 mainline 4.4.230 rev1BootType localVolumes.0.ID 0a123456-1a2b-12a3-a123-1abc0123d456Volumes.0.Name ubuntu_20.04_focal_fossa:volume-0Volumes.0.ExportURI -Volumes.0.Organization 0a123456-1a2b-12a3-a123-1abc0123d456Volumes.0.Server.ID 0a123456-1a2b-12a3-a123-1abc0123d456Volumes.0.Server.Name cli-instance-testVolumes.0.Size 300 GBVolumes.0.VolumeType l_ssdVolumes.0.CreationDate 1 second agoVolumes.0.ModificationDate 1 second agoVolumes.0.State availableVolumes.0.Project 0b123456-1b2b-12b3-b123-1bca0123d456Volumes.0.Boot falseVolumes.0.Zone fr-par-2SecurityGroup.ID 0b123456-1b2b-12b3-b123-1bca0123d456SecurityGroup.Name Default security groupStateDetail -Arch x86_64Zone fr-par-2 -
Type 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-1bca0123d456Image.Name cli-backup-imageImage.Arch x86_64Image.CreationDate nowImage.ModificationDate nowImage.DefaultBootscript x86_64 mainline 4.4.230 rev1Image.ExtraVolumes 0Image.FromServer 012n23ba-25z8-7g97-530a-m6ol1941f001Image.Organization 0b123456-1b2b-12b3-b123-1bca0123d456Image.Public falseImage.RootVolume 012n23ba-25z8-7g97-530a-m6ol1941f001Image.State creatingImage.Project 012n23ba-25z8-7g97-530a-m6ol1941f001Image.Zone fr-par-2 -
Type the following command to create a PLAY2/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-34f4a9f2c3d1Name cli-srv-noisy-herschelOrganization 0a123456-1a2b-12a3-a123-1abc0123d456Project 0a123456-1a2b-12a3-a123-1abc0123d456AllowedActions.0 poweronAllowedActions.1 backupCommercialType PRO2-SCreationDate nowDynamicIPRequired falseEnableIPv6 falseHostname cli-srv-noisy-herschelImage.ID 0b123456-1b2b-12b3-b123-1bca0123d456Image.Name cli-backup-nervous-antonelliImage.Arch x86_64Image.CreationDate 5 minutes agoImage.ModificationDate 5 minutes agoImage.DefaultBootscript x86_64 mainline 4.4.230 rev1Image.ExtraVolumes 0Image.FromServer 027e84ab-12a8-4m07-993c-c3da1941f883Image.Organization 0c518794-9b2f-38g9-a910-9fdf0634b590Image.Public falseImage.RootVolume ah456750-fdc1-4bde-b15e-7d3e1hhhgg74Image.State availableImage.Project 0c514155-7n6s-41a2-a900-9fdf4532b365Image.Zone fr-par-2Protected falsePublicIP.ID 48456zs3-7e85-4a94-bb79-cbccbf03kl0cPublicIP.Address 00.000.000.000PublicIP.Dynamic falseModificationDate nowState archivedBootscript x86_64 mainline 4.4.230 rev1BootType localVolumes.0.ID 760982f8-c321-4cd2-b62c-bc31ef43fccmVolumes.0.Name cli-backup-nervous-antonelli_snap_0Volumes.0.ExportURI -Volumes.0.Organization 0c908137-9d5c-41a2-a900-9fdf0485b365Volumes.0.Server.ID 3921b1b6-8b88-4c75-7800-76e4d9f2c4d6Volumes.0.Server.Name cli-srv-noisy-herschelVolumes.0.Size 300 GBVolumes.0.VolumeType b_ssdVolumes.0.CreationDate nowVolumes.0.ModificationDate nowVolumes.0.State availableVolumes.0.Project 0c769807-9a1e-42a1-o900-9fdf0591b365Volumes.0.Boot falseVolumes.0.Zone fr-par-2SecurityGroup.ID 4917e509-be67-9c12-b42f-bead79081o00SecurityGroup.Name Default security groupStateDetail -Arch x86_64Zone fr-par-2
Your PLAY2/PRO2 Instance is created and displays in the Scaleway console in the Instances dashboard.
Migrating from DEV1/GP1 to PLAY2/PRO2 via the CLI
You can also migrate your existing DEV1/GP1 Instances to PLAY2/PRO2 Instances using the Scaleway CLI.
It is required that you have downloaded and configured the Scaleway CLI on your computer to run the following commands.
- Create a GP1 Instance by running the following command:
scw instance server create type=GP1-S zone=fr-par-2
- Make a backup of the GP1 Instance by using the snapshot feature with the unified snapshot type.
scw instance server backup <server-id-gp1> zone=fr-par-2 unified=true
- Create the PRO2 Instance from the image created by the backup:
scw instance server create image=<image-id-gp1> zone=fr-par-2 type=PRO2-S
- Power on the PRO2 Instance:
scw instance server start <server-id-pro2> zone=fr-par-2