
Migrating block storage volumes between cloud providers requires a structured approach to prevent data loss and ensure a smooth transition. Vultr Block Storage is a high-performance storage solution that offers flexible storage options for various workloads. Amazon Elastic Block Store (EBS) volumes are storage disks attached to Elastic Compute Cloud (EC2) instances, whereas Vultr Block Storage integrates with Vultr Cloud Compute instances. You can leverage the attached instance to transfer data to a Vultr Block Storage volume of an equal or greater size.
Follow this guide to migrate Amazon Elastic Block Store (EBS) volumes to Vultr Block Storage with little or no downtime for your linked applications.
Before you begin, you need to:
In a single Vultr location:
Follow the steps below to set up the migration environment by preparing the source Amazon EC2 instance and the destination Vultr Cloud Compute instance. Verify that an Elastic Block Store (EBS) volume is attached to the source instance and a Vultr Block Storage volume is attached to the destination instance. This ensures both volumes are ready for data transfer.
Follow the steps below to access the source EC2 instance and mount the EBS volume if it's not already mounted.
Access your EC2 instance using SSH as a non-root user with sudo privileges.
Replace user with your username and ec2-ip-address with the public IP address of the EC2 instance.
List all attached devices and verify the block storage volume name.
Your output should be similar to the one below:
The above output shows xvda as the root volume and xvdb as the attached EBS volume, which has a size of 8GB and mounted at /mnt/data_volume. Amazon EBS volumes follow the xvd* naming convention, incrementing with each additional volume, such as xvdc depending on the attached volume.
Create a new /mnt/ebs directory to mount the EBS volume if it's not mounted.
Mount the EBS volume /dev/xvdb to the newly created /mnt/ebs directory.
Verify the filesystem information of the attached block devices.
Your output should be similar to the one below:
ext4 is the active filesystem format for the /dev/xvdb EBS volume mounted with two directories /mnt/data_volume and /mnt/ebs based on the above output. Keep note of the volume's filesystem format to use on your destination Vultr Block Storage volume.
Install the Access Control Lists (ACLs) to effectively manage user permissions.
Install ACL on Debian-based systems (Ubuntu, Debian):
RHEL-based systems (CentOS, Rocky Linux, AlmaLinux):
Grant your user access to the /mnt/ebs directory using ACLs.
The above commands grants the user read only access on the /mnt/ebs directory where the EBS volume is mounted. Replace user with your actual username.
View the disk usage information and verify the volume's usage ratio.
Your output should be similar to the one below:
The source /dev/xvdb block storage volume is mounted on the /mnt/ebs directory with a 1% usage based on the above output.
If your EBS volume has multiple partitions, verify each partition's size and filesystem type to configure the destination Vultr Block Storage volume.
Follow the steps below to set up the destination Vultr Block Storage volume and mount it to the Vultr Cloud Compute instance to begin with the data transfer.
Log in to the Vultr Console.
Navigate to the Vultr Block Storage volume's management page and verify that it's attached to your target Vultr Cloud Compute instance.
Access the Vultr Cloud Compute instance using SSH as a non-root sudo user. Replace Vultr-ip-address with the actual public IP of your Vultr instance.
List all attached devices and verify that the new Vultr Block Storage volume displays.
Your output should be similar to the one below:
The output shows vda as the root volume and vdb as the attached Vultr Block Storage volume with a size of 10GB. Vultr Block Storage volumes use the vd naming scheme, and the disk value increments when additional volumes are attached. For example, vdb, vdc, vdd, and vde based on the number of attached volumes.
Format the /dev/vdb Vultr Block Storage volume with the source's filesystem type, such as ext4.
Create a new /mnt/blockstorage directory to mount the Vultr Block Storage volume.
Mount the /dev/vdb Vultr Block Storage volume to the newly created directory.
Grant your user full permissions to the /mnt/blockstorage directory.
View the disk usage information and verify that the volume is mounted.
Your output should be similar to the one below:
The above output shows that the Vultr Block Storage volume /dev/vdb is mounted at /mnt/blockstorage.
If the source EBS volume has multiple partitions, then configure your destination Vultr Block Storage volume with same filesystem format and ensure each partition has enough space for the data migration.
Follow the steps below to set up SSH key-based authentication to securely transfer data between your source and destination instance without requiring a password. This method enhances security and simplifies the migration process.
Access the source instance using SSH as a non-root user with sudo privileges. Replace user and ec2-ip-address with your actual credentials.
Create a new SSH key pair using the ed25519 algorithm to authenticate with your Vultr Cloud Compute instance.
This command generates two files:
~/.ssh/vultr_migration - The private key (keep this secure).~/.ssh/vultr_migration.pub - The public key (to be added to the Vultr instance).When prompted for a passphrase, press Return twice to leave it empty unless additional security is required.
Add the SSH public key to the destination Vultr instance to enable key-based authentication. Replace Vultr-ip-address with the public IP of your Vultr instance.
This command adds the public key to the ~/.ssh/authorized_keys file on the Vultr instance, allowing secure access without a password. When prompted, enter "yes" to confirm the connection and then enter your Vultr instance password.
Test the SSH connection to the Vultr instance using the new SSH key. Replace Vultr-ip-address with the public IP of your Vultr instance.
If the connection is successful, you should see an output similar to the one below:
This confirms that authentication is working without requiring a password.
After verifying the connection, exit the session to go back to the EC2 instance.
Amazon Elastic Block Store (EBS) volumes store persistent data in AWS EC2 instances, but migrating to Vultr Block Storage offers cost savings, flexibility, and better integration with Vultr infrastructure. Rclone is an open-source command-line tool that is used to manage files on cloud storage and helps in simplifying the migration process by securely transferring data between cloud storage providers.
Access the source instance using SSH as a non-root user with sudo privileges. Replace user and SERVER_IP with your actual credentials.
Download the latest Rclone installation script.
Run the script rclone.sh using bash to install Rclone.
View the installed Rclone version.
Your output should be similar to the one below:
Generate a new Rclone configuration file.
Your output should be similar to the one below:
Open the Rclone configuration file.
Add the following Rclone configuration to the file used to access the Vultr instance. Replace Vultr-ip-address with the public IP of your Vultr instance.
Save and exit the file.
Verify the connection by running the following command, which returns the list of directories present in the Vultr instance.
Your output should be similar to the one below:
Transfer all the volume data from Amazon EBS to Vultr Block Storage.
In the above command:
/mnt/ebs: Source EBS volume.vultr:/mnt/blockstorage: Destination Vultr Block Storage volume.--progress: Displays transfer progress.--stats=1s: Updates transfer statistics every second.The migration process may take some time to complete depending on the size of the EBS volume, network speed, and the number of files being transferred. Larger volumes may take several hours to complete.
Your output should be similar to the one below:
If you have multiple EBS volumes to migrate, execute the same rclone copy command for each volume.
After migrating the source volume data, it's important to test the data integrity and ensure that no files were corrupted or omitted during the migration process. Follow the steps below to verify data integrity and confirm that the contents of the Vultr Block Storage volume match those of the source Amazon EBS volume.
The above command compares the size and file hash (MDA5 and SHA1) in the source EBS volume against the destination Vultr Block Storage volume. The --one-way flag checks that all files in the source are present in the destination.
Your output should be similar to the one below:
Cutting over to Vultr Block Storage after migrating your EBS volume allows you to transfer your applications and services. Follow the recommendations below when the migration is successful and cut over your applications or services to Vultr Block Storage.
You have migrated an Amazon Elastic Block Store (EBS) volume to Vultr Block Storage using Rclone. You can now manage your storage needs with Vultr Block Storage, resize volumes when you need more space, and attach volumes to different instances. For additional information about Vultr Block Storage, refer to the official documentation.
0 Comments
Be the first to comment and share your perspective with the community.