How can I migrate a Windows Lightsail instance to an Amazon EC2 instance for troubleshooting purposes?
Last updated: 2021-03-17
I have an Amazon Lightsail instance running Windows that I need to troubleshoot. How can I migrate the Lightsail instance to an Amazon Elastic Compute Cloud (Amazon EC2) instance?
You can create a snapshot of your Lightsail instance and then export it to Amazon EC2. Use this method to connect to and troubleshoot an unreachable Lightsail instance.
Note: To export your Lightsail instance to Amazon EC2 for reasons other than troubleshooting, see Creating a snapshot of your Windows Server instance in Amazon Lightsail.
Before exporting your snapshot, keep the following in mind:
- The exported snapshot doesn't retain the public or private IP address from the Lightsail instance.
- The export process works only one way. It's not currently possible to export instances from Amazon EC2 back to Lightsail.
- For Windows Server 2016 and later operating systems, you might receive a "Password not available" error message when logging in to the EC2 instance for the first time. If you receive this error, use the same credentials you used for the Lightsail instance to log in to the exported EC2 instance. You can change the password after the initial log in.
Create a Lightsail snapshot and export it
1. Sign in to the Amazon Lightsail console.
3. Open the Snapshots tab of the home page and expand the dropdown list for the Lightsail instance that you want to export.
4. Open the snapshot menu (the vertical dots on the far-right), and then select Export to Amazon EC2.
5. Review the information in the dialog box, and then choose Yes, Continue.
Note: The export might run for a long time, depending on the size and configuration of the source Lightsail instance or block storage disk. You can check the progress from the Lightsail Task Monitor menu. Or, you can view the progress from the Amazon EC2 console by selecting AMIs.
Create a new EC2 instance from the exported snapshot
6. Open the Amazon EC2 console.
7. Select AMIs.
8. Select the exported AMI and then choose the Launch button.
9. Choose the instance type, and networking configurations for the EC2 instance. If you don't have an existing key pair, choose Create a new key pair. Create the key pair, download it, and then launch the instance. For more information see Amazon EC2 key pairs and Windows instances.
10. After the instance is running and passing status checks, you can connect to it.
Troubleshoot or recover data from the Lightsail snapshot
1. Launch a Windows EC2 instance in the same Region as the exported snapshot. This is your helper instance. Note which Availability Zone the instance is launched in.
2. Select Snapshots, and then select the snapshot that you want to troubleshoot or recover data from.
3. Select Actions, Create Volume. Be sure to create the volume in the same Availability Zone as the helper instance.
4. After the EBS volume is in the available state, select Actions, Attach to attach the volume to the helper instance.
5. Connect to the helper instance and then open Disk Management.
6. Bring the secondary volume online. Now you can access the volume to investigate or retrieve the data you need.