IBM Cloud Docs
Migrating data from IBM Cloud® classic infrastructure to VPC

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:

  1. You need an existing VPC environment.
  2. You are aware of the storage capabilities and differences between classic and VPC.
  3. 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:

  1. Make sure that VRF is enabled on the classic infrastructure.
  2. Make sure that the IP network spaces don't overlap. Your VPC IP address must not be present in the classic infrastructure IP range.
  3. 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

  1. You need to be the "root" user to install the package.
  2. Run sudo apt-get install rsync.

Debian

  1. Log in with root.
  2. Run apt-get update.

RHEL

  1. Log in with root.
  2. Run yum install rsync.

CentOS

  1. Log in with root.
  2. Run yum -y install rsync.

Windows systems

Complete the following steps to install rsync on your Windows 2012, 2012R2, or 2016 system.

  1. Download Cygwin setup-x86_64 (https://cygwin.com/install.html).
  2. Install downloaded setup (https://cygwin.com/setup-x86_64.exe).
  3. Follow through all of the steps until you see a list of all Linux packages.
  4. Select rsync (in net category section).
  5. Select OpenSSH (in net category section).
  6. Click Continue and finish the installation.
  7. Open ‘Cygwin Terminal’, type rsync command, and press enter.
  8. 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:

  1. Microsoft's documentation on Installation of OpenSSH for Windows Server 2019 and Windows 10
  2. 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:

  1. Download OpenSSH-Win64.zip: https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.1.0.0p1-Beta/OpenSSH-Win64.zip
  2. Instructions for installation: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH

Step 4: Generate SSH keys

Linux systems

  1. Generate the private-public key by using the command ssh-keygen -t rsa
  2. Save the generated keys to {User’s home directory}/.ssh
  3. Copy the public key to the destination server by using the following path: {user’s home directory}/.ssh/authorized_keys

Windows systems

  1. Generate the private-public key by using the command ssh-keygen -t rsa
  2. Save the generated keys to C:\Users\{username}\.ssh
  3. 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

  1. Type Bash <auto_rsync_file_name> and press enter.
  2. Enter the path of the source: /home/Demo-12Jan/12Jan_test1.txt
  3. Enter the path of the destination: /home/19Jan
  4. Enter the address of the target server: 192.168.0.5
  5. Enter the target username: root
  6. (Optional) Enter custom options. For a list of custom options, see https://linux.die.net/man/1/rsync.
  7. Enter and rsync process starts.

Windows systems

  1. Download or copy and paste file to directory /cygdrive/c/cygwin64/home/Administrator of source server.
  2. Open Cygwin terminal.
  3. Type cd /cygdrive/c/cygwin64/home/Administrator
  4. Type Bash ./<auto_rsync_file_name> and press enter.
  5. Enter the path of the source: /cygdrive/c/home/Demo-12Jan/12Jan-test1.txt
  6. Enter the path of the destination: /cygdrive/c/home/19Jan/
  7. Enter the address of the target server: 192.168.0.5
  8. Enter the target username: Administrator
  9. (Optional) Enter custom options.
  10. Enter and rsync process starts.