Back to Cloud VPS Documentation

    Migrate from DigitalOcean to RamNode

    Complete step-by-step guide to migrating your DigitalOcean droplets to RamNode Cloud VPS.

    Introduction

    This guide provides step-by-step instructions for migrating your virtual private servers (VPS) from DigitalOcean to RamNode. Whether you're moving a single droplet or multiple production workloads, this document covers everything from initial preparation through final verification.

    DigitalOcean does not provide a native export feature for snapshots, so migration requires creating a disk image directly from your running droplet and uploading it to RamNode's cloud platform. RamNode supports multiple image formats including RAW, QCOW2, VMDK, VDI, and VHD/VHDX, making it compatible with images from various virtualization platforms.

    Supported Image Formats

    FormatDescriptionRecommended
    RAWUncompressed disk image, byte-for-byte copyFor speed
    QCOW2QEMU Copy-On-Write format with compressionBest overall
    VMDKVMware virtual disk formatVMware migrations
    VDIVirtualBox disk image formatVirtualBox migrations
    VHD/VHDXMicrosoft Hyper-V formatHyper-V migrations

    Recommendation: QCOW2 is the preferred format for most migrations due to its efficient compression, which significantly reduces upload times and storage costs.

    Prerequisites

    • Root or sudo access to your DigitalOcean droplet
    • A RamNode Cloud account (sign up at cloudorder.ramnode.com)
    • A destination server with sufficient storage for the disk image (can be temporary)
    • SSH access configured on your droplet
    • The qemu-utils package installed on your source or destination system

    1Full Disk Image Export (Recommended)

    This method creates a complete byte-for-byte copy of your droplet's disk, preserving all data, configurations, and the boot environment.

    Step 1: Prepare the Droplet

    Before creating the disk image, prepare your droplet to ensure data consistency:

    1. Stop all non-essential services to minimize disk writes during the copy:

    sudo systemctl stop apache2   # or nginx
    sudo systemctl stop mysql     # or postgresql, mariadb
    sudo systemctl stop redis
    sudo systemctl stop docker

    2. Install required utilities if not already present:

    Debian/Ubuntu:

    sudo apt update && sudo apt install -y qemu-utils gzip

    CentOS/RHEL/Rocky/Alma:

    sudo yum install -y qemu-img gzip

    3. Sync the filesystem to ensure all data is written to disk:

    sudo sync

    Step 2: Create the Disk Image

    Create and transfer the disk image to a remote server in a single operation. This approach streams the data directly, avoiding the need for local storage:

    sudo dd if=/dev/vda bs=4M status=progress \
      | gzip -1 \
      | ssh user@destination-server 'cat > droplet-image.img.gz'

    Important: The device name is typically /dev/vda on DigitalOcean droplets. Verify with lsblk before proceeding.

    For droplets with separate partitions (if you only need the root filesystem):

    # Copy only the root partition
    sudo dd if=/dev/vda1 bs=4M status=progress \
      | gzip -1 \
      | ssh user@destination-server 'cat > droplet-partition.img.gz'

    Step 3: Convert to QCOW2 Format

    On your destination server, decompress and convert the image to QCOW2 for optimal upload:

    # Decompress the image
    gunzip droplet-image.img.gz
    
    # Convert RAW to QCOW2 with compression
    qemu-img convert -f raw -O qcow2 -c droplet-image.img droplet-image.qcow2
    
    # Verify the conversion
    qemu-img info droplet-image.qcow2

    The compression typically reduces the image size by 50-80%, significantly speeding up the upload to RamNode.

    2Application-Level Migration

    For complex environments or when you want a fresh system with migrated data, consider an application-level migration:

    1. Deploy a fresh instance on RamNode using your preferred operating system
    2. Use rsync to transfer application data and configurations:
      rsync -avzP --exclude='/dev/*' --exclude='/proc/*' \
        --exclude='/sys/*' --exclude='/tmp/*' --exclude='/run/*' \
        root@old-droplet:/ /destination/path/
    3. Reinstall and configure applications on the new instance
    4. Restore databases using native backup/restore tools (mysqldump, pg_dump, etc.)

    Uploading to RamNode Cloud

    Via Cloud Control Panel (Under 2GB)

    For images under 2GB, the web interface is the simplest option:

    1. Log into the Cloud Control Panel at cloud.ramnode.com
    2. Navigate to Compute → Images
    3. Click Create Image
    4. Select File as the source and choose your QCOW2 file
    5. Specify the image details:
      • Name: A descriptive name for your image
      • Format: Select QCOW2 (or your image format)
      • Minimum disk size: The original droplet's disk size or larger
      • Minimum RAM: The recommended RAM for your workload
    6. Click Create Image and wait for the upload to complete

    For Large Images (Over 2GB) via OpenStack CLI

    For images larger than 2GB, use the OpenStack CLI for reliable uploads:

    Step 1: Download Your Region's Authentication File

    Go to cloud.ramnode.com, navigate to API Access, and download the OpenRC file for your target region.

    Step 2: Install OpenStack CLI

    pip install python-openstackclient

    Step 3: Source the Authentication File

    source openrc

    Step 4: Upload the Image

    openstack image create --disk-format qcow2 --container-format bare --file <file.qcow2> <image-name>

    Example:

    openstack image create --disk-format qcow2 --container-format bare --file droplet-image.qcow2 DigitalOcean-WebServer

    Note: There is no progress bar. When it completes, it will return to the command prompt.

    For detailed OpenStack CLI instructions, see our Region Migration Guide.

    Launching Your Instance

    Create Instance from Image

    Once your image is uploaded and available:

    1. Go to Compute → Instances in the Cloud Control Panel
    2. Click Launch Instance
    3. Select your custom image as the boot source
    4. Choose an appropriate instance size (equal to or larger than original)
    5. Configure networking, security groups, and SSH keys
    6. Launch the instance

    Post-Migration Tasks

    After launching your instance, complete these verification steps:

    Network Configuration

    If your image was not configured with cloud-init, you may need to update the network configuration:

    # Check current network configuration
    ip addr show
    
    # If using static IP (update as needed)
    sudo nano /etc/netplan/01-netcfg.yaml           # Ubuntu 20.04+
    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0  # CentOS/RHEL

    Service Verification

    Verify all critical services are running:

    # Check service status
    sudo systemctl status nginx apache2 mysql postgresql
    
    # Review system logs for errors
    sudo journalctl -xe --since '10 minutes ago'
    
    # Verify listening ports
    sudo ss -tlnp

    Update DNS Records

    1. Note your new instance's public IP address
    2. Update A/AAAA records with your DNS provider
    3. Consider lowering TTL before migration for faster propagation
    4. Verify DNS propagation using tools like dig or nslookup

    Troubleshooting

    Instance Won't Boot

    • Check VNC console: Access the VNC console in the Cloud Control Panel to see boot errors
    • Verify disk drivers: Ensure virtio drivers are installed (most modern Linux distros include these)
    • GRUB configuration: DigitalOcean uses a custom GRUB configuration; you may need to reinstall GRUB
    • Image integrity: Verify the image wasn't corrupted during transfer (compare checksums)

    Network Not Working

    • Install cloud-init: If not present, install cloud-init for automatic network configuration
    • Check interface names: Interface names may differ between providers (eth0 vs ens3)
    • Virtio network driver: Ensure virtio network drivers are loaded
    • DHCP configuration: Verify the network interface is configured for DHCP

    Fixing GRUB for RamNode

    If your instance fails to boot due to GRUB issues, you can fix it by mounting the image and reinstalling:

    # Mount the image (on a rescue system or helper VM)
    sudo mount /dev/vda1 /mnt
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    
    # Chroot and reinstall GRUB
    sudo chroot /mnt
    grub-install /dev/vda
    update-grub
    exit
    
    # Unmount and reboot
    sudo umount -R /mnt

    Getting Help: If you encounter issues during migration, RamNode's support team is available at clientarea.ramnode.com. For complex migrations, consider RamNode's professional services team.

    Best Practices

    • Keep the original droplet running: Maintain your DigitalOcean droplet until you've fully verified the RamNode instance
    • Test thoroughly: Run comprehensive tests on the new instance before switching production traffic
    • Install cloud-init: Add cloud-init to your image before migration for better cloud integration
    • Use virtio drivers: Ensure virtio drivers are enabled for optimal disk and network performance
    • Document everything: Keep records of IP addresses, configurations, and any changes made during migration
    • Plan for downtime: Schedule migrations during low-traffic periods and communicate with stakeholders