Migrating data from IBM Cloud® classic infrastructure to VPC
The following guide shows you how to connect your IBM Cloud® classic infrastructure to VPC to migrate your data, especially for block or file volumes, as part of your migration journey. While many different data migration tools are available,
the following guide uses rsync
. Rsync
is an open source utility that provides file transfer between two devices. It is available for both Linux and Windows platforms.
You can use other data migration tools instead of rsync
to move your data to VPC.
Before you begin
Before you begin migrating your data, review the following requirements and considerations:
- You need an existing VPC environment.
- You are aware of the storage capabilities and differences between classic and VPC.
- Back up your data before you begin the migration process.
Step 1: Create IBM Cloud® Transit Gateway and establish a connection between classic and VPC
Your classic infrastructure and VPC infrastructure need to be able to reach each other, which can be achieved in many ways: public interfaces, VPN, transit gateway. If you need to move data from a few servers, you might want to use a public interface. However, if you have a large amount of data from different sources or large data sets, then you need to use IBM Cloud Transit Gateway, which uses IBM Cloud to interconnect between classic and VPC.
Before you create your IBM Cloud Transit Gateway, review the following requirements and considerations:
- Make sure that VRF is enabled on the classic infrastructure.
- Make sure that the IP network spaces don't overlap. Your VPC IP address must not be present in the classic infrastructure IP range.
- Make sure that your classic infrastructure data centers are able to connect to VPC.
To create IBM Cloud Transit Gateway and establish the connection between classic and VPC, review the following information:
If your compute resource has both public and private IP addresses, the host level route needs to be added for it to work properly. Run the following command on your classic compute resources for your relevant operating system:
Linux systems
ip route add <destination_network> via <Gateway_address> dev <private_ethernet_interface>
Windows systems
route ADD <destination_network> MASK <subnet_mask> <gateway_ip>
Step 2: Install rsync
Linux systems
On most Linux systems, rsync
is already installed. To verify whether rsync
in installed, run the rsync
command on your terminal. If it isn't installed, complete the following steps for your relevant operating
system.
Ubuntu
- You need to be the "root" user to install the package.
- Run
sudo apt-get install rsync
.
Debian
- Log in with root.
- Run
apt-get update
.
RHEL
- Log in with root.
- Run
yum install rsync
.
CentOS
- Log in with root.
- Run
yum -y install rsync
.
Windows systems
Complete the following steps to install rsync
on your Windows 2012, 2012R2, or 2016 system.
- Download Cygwin setup-x86_64 (https://cygwin.com/install.html).
- Install downloaded setup (https://cygwin.com/setup-x86_64.exe).
- Follow through all of the steps until you see a list of all Linux packages.
- Select
rsync
(in net category section). - Select OpenSSH (in net category section).
- Click Continue and finish the installation.
- Open ‘Cygwin Terminal’, type
rsync
command, and press enter. - If the output shows
rsync
command details with options, then it is installed.
Step 3: Install OpenSSH
Linux systems
If you have a Linux system, you don't need to install OpenSSH because it is installed by default.
Windows systems
Windows 2016
To install OpenSSH on your Windows 2016 system, review the following information:
- Microsoft's documentation on Installation of OpenSSH for Windows Server 2019 and Windows 10
- GitHub instructions on Installation of OpenSSH for Windows
Windows 2012 and 2012R2
To install OpenSSH on your Windows 2012 or 2012R2 system, review the following information:
- Download OpenSSH-Win64.zip: https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.1.0.0p1-Beta/OpenSSH-Win64.zip
- Instructions for installation: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
Step 4: Generate SSH keys
Linux systems
- Generate the private-public key by using the command
ssh-keygen -t rsa
- Save the generated keys to
{User’s home directory}/.ssh
- Copy the public key to the destination server by using the following path:
{user’s home directory}/.ssh/authorized_keys
Windows systems
- Generate the private-public key by using the command
ssh-keygen -t rsa
- Save the generated keys to
C:\Users\{username}\.ssh
- Copy the public key to the destination server by using the following path:
C:\Users\{username}\.ssh\authorized_keys
Step 5: Run auto rsync
script
Download the auto rsync
scripts here.
Linux systems
- Type
Bash <auto_rsync_file_name>
and press enter. - Enter the path of the source:
/home/Demo-12Jan/12Jan_test1.txt
- Enter the path of the destination:
/home/19Jan
- Enter the address of the target server:
192.168.0.5
- Enter the target username:
root
- (Optional) Enter custom options. For a list of custom options, see https://linux.die.net/man/1/rsync.
- Enter and
rsync
process starts.
Windows systems
- Download or copy and paste file to directory
/cygdrive/c/cygwin64/home/Administrator
of source server. - Open Cygwin terminal.
- Type
cd /cygdrive/c/cygwin64/home/Administrator
- Type
Bash ./<auto_rsync_file_name>
and press enter. - Enter the path of the source:
/cygdrive/c/home/Demo-12Jan/12Jan-test1.txt
- Enter the path of the destination:
/cygdrive/c/home/19Jan/
- Enter the address of the target server:
192.168.0.5
- Enter the target username:
Administrator
- (Optional) Enter custom options.
- Enter and
rsync
process starts.