> For the complete documentation index, see [llms.txt](https://docs.plenit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plenit.com/docs-en/productos/migrations/how-to/como-migrar-un-servidor-gnulinux-desde-aws-a-plenit.md).

# How to Migrate a GNU/Linux Server from AWS to Plenit

To migrate a GNU/Linux server from AWS to Plenit, you export the instance disk to an S3 bucket in VHD format and then import it into Plenit via the object's URL.

Most of the work is on the AWS side: preparing the machine, setting up an S3 bucket with the correct permissions, and launching the export with the AWS CLI.

<br>

> 👍 What you get
>
> Your AWS instance disk exported to S3 in VHD format and imported into Plenit via its URL, ready to deploy the target server.

<br>

### Before you begin

* Log in to the Plenit platform with company administrator permissions or on a subscription of **Servers**.
* Have access to the section **Migrations** within **Cloud Services**.
* Have an AWS subscription with at least one server to export.

<br>

> ❗️ What AWS does not allow you to export
>
> Before you begin, check that your case does not run into AWS limits:
>
> * It does not export images with third-party AWS software: neither **Windows**, nor **SQL Server**, nor images created from the **AWS Marketplace**.
> * It does not export images with snapshots of **encrypted EBS** in the block device mapping.
> * It only exports EBS data volumes from the block device mapping; not those **added after launching** the instance.
> * It does not export images **shared from another AWS account** .
> * Maximum **5 conversion tasks per region** in parallel (expandable to 20).
> * It does not export volumes **larger than 1 TB**.

<br>

### Step 0. Prepare the GNU/Linux machine

Before exporting, get the source server ready:

* Enable **SSH** for remote access and allow SSH sessions in the machine's firewall (for example, in `iptables`).
* Create a **non-root additional user** to work over SSH.
* Check that the machine uses **GRUB** (Legacy or GRUB 2) as the boot loader.
* Check that the root file system is one of these: **EXT2, EXT3, EXT4, Btrfs, JFS or XFS**.

<br>

To verify the file system and boot:

```bash
lsblk -f            # file system type of each volume
ls /boot/grub*      # presence of GRUB / GRUB2
```

<br>

### Step 1. Install the AWS CLI on your computer

Install the AWS command line interface on the computer from which you are going to launch the migration (in Windows, the installer `.msi`, adding it to the Path; in Linux, via Python and Pip). Then check that it responds:

```bash
aws --version
```

{/\* 📸 SCREENSHOT 1 · AWS CLI version check \*/}

![AWS CLI version check](https://REEMPLAZA-URL/servidores-migracion-aws-01.png)

<br>

### Step 2. Prepare the S3 bucket

#### 2.1 Create the bucket in the same region

In the AWS console, search for **S3** and click **Create bucket**. Give it a **name** and choose the **region**.

> ❗️ Same region as the instance
>
> The S3 bucket must be in the same region as the machine you are going to export. If the instance is in Ireland (`eu-west-1`), the bucket must be too.

<br>

In **Object properties**, check **ACLs enabled**.

{/\* 📸 SCREENSHOT 2 · bucket creation with name, region, and ACLs enabled \*/}

![S3 bucket creation with name and region](https://REEMPLAZA-URL/servidores-migracion-aws-02.png)

<br>

#### 2.2 Allow the necessary access

In **Block public access**, uncheck **Block all public access** and accept the warning. Leave the rest as default and click **Create bucket**.

{/\* 📸 SCREENSHOT 3 · unblocking public access to the bucket \*/}

![Bucket public access settings](https://REEMPLAZA-URL/servidores-migracion-aws-03.png)

<br>

#### 2.3 Add the Plenit beneficiary in the ACL

Open the bucket, tab **Permissions → Access control list (ACL) → Edit**. Click **Add grantee**, enter the Plenit canonical grantee string, check **Read** and **Write** and **Save changes**.

<br>

> 🚧 Confirm the grantee string
>
> It is the Plenit account identifier that will pick up the export from your bucket. Use the current value provided by Partner Success; if it is not correct, the export will not be delivered.

{/\* 📸 SCREENSHOT 4 · editing the ACL adding the grantee with read/write \*/}

![Bucket ACL edit to add the grantee](https://REEMPLAZA-URL/servidores-migracion-aws-04.png)

### Step 3. Export the AWS instance

#### 3.1 Locate the instance ID

In the console, search for **EC2 → Instances**, locate the machine to migrate and copy its **instance ID** (`i-…`). Keep it.

{/\* 📸 SCREENSHOT 5 · EC2 · ID of the instance to export \*/}

![Copying the instance ID in EC2](https://REEMPLAZA-URL/servidores-migracion-aws-05.png)

<br>

#### 3.2 Create the access keys

From the user profile, go to **Security credentials → Access keys → Create access key**. Copy the **access key ID** and the **secret key** and download the key file. You will use them to authenticate the AWS CLI.

{/\* 📸 SCREENSHOT 6 · creation and download of the access keys \*/}

![Creation of AWS access keys](https://REEMPLAZA-URL/servidores-migracion-aws-06.png)

<br>

#### 3.3 Prepare the export file

Create a file `file.json` with the output format (**VHD**, to import it into Plenit), the bucket and the prefix (the folder where the export will be stored):

```json
{
  "DiskImageFormat": "VHD",
  "S3Bucket": "your-bucket",
  "S3Prefix": "vms/"
}
```

Write down the path where you save the file; you need it in the command. On Linux, give the file read permission.

<br>

#### 3.4 Load the credentials and launch the export

Load the environment variables with your region and your keys. In PowerShell (Windows):

```powershell
$Env:AWS_DEFAULT_REGION='eu-west-1'
$Env:AWS_ACCESS_KEY_ID='<ACCESS-KEY-ID>'
$Env:AWS_SECRET_ACCESS_KEY='<SECRET-KEY>'
echo $Env:AWS_DEFAULT_REGION   # check that it was loaded
```

In GNU/Linux it's the same with `export`:

```bash
export AWS_DEFAULT_REGION='eu-west-1'
export AWS_ACCESS_KEY_ID='<ACCESS-KEY-ID>'
export AWS_SECRET_ACCESS_KEY='<SECRET-KEY>'
echo $AWS_DEFAULT_REGION
```

Launch the export task with the instance ID and the path to the `file.json`:

```bash
aws ec2 create-instance-export-task --instance-id <INSTANCE-ID> --target-environment microsoft --export-to-s3-task file://<PATH-TO-FILE>
```

{/\* 📸 SCREENSHOT 7 · PowerShell · loading variables and export command \*/}

![Loading variables and instance export command](https://REEMPLAZA-URL/servidores-migracion-aws-07.png)

<br>

#### 3.5 Retrieve the VHD URL

The process takes as long as the server size. When it finishes, go to the S3 bucket, open the folder for the prefix you defined (for example, `vms/`), and, on the VHD, **copy the URL** of the object. That is the one you will use to import into Plenit (you can also download the VHD, but for the migration the practical option is the URL).

{/\* 📸 SCREENSHOT 8 · S3 bucket · VHD object with the option to copy the URL \*/}

![Copying the VHD URL in the S3 bucket](https://REEMPLAZA-URL/servidores-migracion-aws-08.png)

<br>

### Step 4. Import the disk into Plenit

In **Cloud Services → Migrations**, click **New migration**.

> 🚧 Import from the same computer used for the AWS operation
>
> The URL-based import must be launched from the computer where you carried out the entire AWS process.

<br>

#### 4.1 Service and source type

Select **Servers** and, as the type, **Virtual**.

{/\* 📸 SCREENSHOT 9 · wizard · Servers service and Virtual type \*/}

![Selection of Servers and Virtual type in the wizard](https://REEMPLAZA-URL/servidores-migracion-aws-09.png)

<br>

#### 4.2 Disk format, method, and data

Select **Compatible Virtual Disks** as the format and **download via URL** as the delivery method (faster than FTP, because it avoids the intermediary). Fill in the disk data:

* **File name** with its extension (the one from Step 3).
* **Disk URL**: the one you copied from the bucket.
* **Disk type**: the operating system's main, system disk; the rest, data disks.
* **Display Name**: the disk identifier in the console.

Click **Next**.

{/\* 📸 SCREENSHOT 10 · wizard · download by URL and disk data \*/}

![Format, URL method, and disk data](https://REEMPLAZA-URL/servidores-migracion-aws-10.png)

<br>

#### 4.3 Organization, subscription, and deployment

Indicate the **organization**, the **subscription** and the **availability zone** where to upload the disk. For the question about deploying a new server with the imported disks, the usual answer is **Yes**.

{/\* 📸 SCREENSHOT 11 · wizard · organization, subscription, zone, and deploy option \*/}

![Selection of organization, subscription and deployment](https://REEMPLAZA-URL/servidores-migracion-aws-11.png)

<br>

#### 4.4 Target server

If you chose to deploy, specify the **name** (spaces allowed), the **operating system**, the **size** (CPU and RAM) and the **network type** (standard or VPC). Click **Finish**.

{/\* 📸 SCREENSHOT 12 · wizard · target server configuration \*/}

![Target server configuration](https://REEMPLAZA-URL/servidores-migracion-aws-12.png)

With this, the foundations of the migration are laid and the internal processes begin that lead to the deployment of the server in the chosen subscription.

<br>

### Conclusion

This migration is the most laborious in the block because almost everything happens in AWS: preparing the machine, leaving the S3 bucket with the correct region and permissions, loading the credentials, and launching the export to VHD.

Two things completely determine it: respecting AWS export limits (no Windows, SQL Server, Marketplace images, or volumes larger than 1 TB) and having the Plenit beneficiary correctly set in the bucket ACL, because that is what allows the export to be retrieved. With the VHD already in S3, importing it into Plenit is just pasting its URL into the wizard, provided you do it from the same computer where you did the work in AWS.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.plenit.com/docs-en/productos/migrations/how-to/como-migrar-un-servidor-gnulinux-desde-aws-a-plenit.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
