This guide describes, in general terms, the steps to import a server to Vultr. The exact procedure for each OS distribution and virtualization platform varies. Where possible, we've included links to further documentation. Please research the provided links for your configuration before beginning a migration. Please note that Vultr is responsible for the platform infrastructure, but not the administration of VPS instances. You are responsible for the administration of the VPS deployments on your account. If you have difficulties performing a task in your account portal, please open a support ticket.
Before migrating your server, ensure it meets the Vultr requirements:
Make sure your workstation has enough free disk space to convert the disk images into raw format before uploading it to Vultr.
Before performing any operations on your existing server, make a full backup and know how to restore it.
This step is optional but highly recommended. Before creating the raw image, clean up the server as much as possible. Remove old logs, temporary files, etc. to free up disk space. Overwrite free disk sectors with zeros to improve compression and wipe recently-deleted data for security. Two standard utilities to wipe free disk space are zerofree and dd.
# zerofree -v /dev/sda2
If zerofree is not available, use dd. This example creates a temporary file with zeros to fill the disk, then deletes the file.
# dd if=/dev/zero of=/tmpfile bs=4096k; rm -f /tmpfile
For Windows servers, use the sdelete utility. The -z option will fille the empty space with zero bytes. Download sdelete from the Windows Sysinternals site. Open an administrative command prompt, and run sdelete on the desired volume.
C:\> sdelete -z c:
The server capture process varies depending on the source platform. Here are the most common export steps with links to relevant documentation.
If you have enough disk space available and can do the conversion directly on the host machine, you may skip this step. If you need to perform image conversion on a different computer or upload it from a different location, you may want to export your server to external media. Here are instructions for several popular systems.
The dd utility is a popular way to capture a raw disk image. The source disk should be dismounted before imaging. One common technique is to temporarily boot the server using the SystemRescueCD live ISO. You will need to mount a storage location to save the raw image.
Assuming the server data device is
/dev/sda and the image will be written to
/mnt/usb_external/server_image.img, use the following command from a root terminal.
# dd if=/dev/sda bs=1M of=/mnt/USB_external/server_image.img
Two popular options for Windows imaging are ntfsclone, and disk2vhd. The SystemRescueCD live ISO includes ntfsclone, and the full documentation is available online. Disk2vhd from Microsoft Sysinternals can capture a live running system. It can also save the resulting image directly on the server, if enough free space is available.
Vultr VPS images are compatible with QEMU. To verify the VirtIO drivers are installed properly, launch the server in QEMU on your local system before uploading it to Vultr. QEMU is available for all platforms.
Vultr requires snapshots in raw image format. If you created a raw image with dd, no conversion is necessary. If your exported image is not in raw format, use the free utilities from QEMU or VirtualBox. Versions are available for Linux, Windows, and macOS.
$ qemu-img convert -f vmdk -O raw image.vmdk image.img
$ VBoxManage clonemedium disk /path/to/image.vdi image.img --format raw
To add the snapshot to your Vultr account, stage the image at any publicly-accessible URL. Some suggested options are:
On a slow internet connection, you can temporary deploy a Vultr One-Click LAMP app as a staging location. Then, use scp or rsync to compress the upload stream and dramatically improve the upload speed.
Upload the RAW image with compression. These examples use 192.0.2.123 as the One-Click LAMP IP address:
Option 1: Use
From a terminal (or PowerShell on Windows) on your local workstation, use
scp with the
-C parameter for compression.
$ scp -C image.img firstname.lastname@example.org:/var/www/html/image.img
Option 2: Use
rsync is available on your workstation, it is faster than
scp in most cases.
$ rsync -z --progress image.img email@example.com:/var/www/html/image.img
After the transfer completes, use the public URL of the One-Click LAMP server to add the image as a Vultr Snapshot.
Navigate to Products > Snapshots > Add Snapshot in your customer portal.
Enter the URL of your image and click Upload.
Restore the server snapshot, following the steps from the VPS Snapshots Quickstart Guide. Make sure the VPS SSD is the same size, or larger, than the server snapshot.
Log into your newly-deployed server. Verify that the disk, partition, and filesystem sizes are correct.
If needed, use resize2fs to expand the filesystem to the full partition size. Substitute vda1 with your device name.
$ sudo resize2fs /dev/vda1
Here are links to useful resources when migrating to a new Vultr VPS.