Install

Prerequisites

The following sections describe the prerequisites for installing YugabyteDB Voyager.

Operating system

You can install YugabyteDB Voyager on the following:

  • RHEL 7/8
  • CentOS 7/8
  • Ubuntu 18.04, 20.04, 22.04
  • macOS (For MySQL/Oracle source databases on macOS, install yb-voyager using the Docker option.)

Hardware requirements

  • Disk space of at least 1.5 times the estimated size of the source database
  • 2 cores minimum (recommended)

Software requirement

  • Java 11 or later. For better performance, the recommended version is Java 17.

Prepare the host

The node where you'll run the yb-voyager command should:

  • connect to both the source and the target database.
  • have sudo access.

Install yb-voyager

YugabyteDB Voyager consists of the yb-voyager command line executable.

Install yb-voyager on a machine which satisfies the Prerequisites using one of the following options:

Perform the following steps to install yb-voyager using yum for RHEL 7/8 and CentOS 7/8:

  1. Update the yum package manager, and all the packages and repositories installed on your machine using the following command:

    sudo yum update
    
  2. Install the yugabyte yum repository using the following command:

    sudo yum install https://s3.us-west-2.amazonaws.com/downloads.yugabyte.com/repos/reporpms/yb-yum-repo-1.1-0.noarch.rpm
    

    This repository contains the yb-voyager rpm and other dependencies required to run yb-voyager.

  3. Install the epel-release repository using the following command:

    # For RHEL 7 or CentOS 7
    sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    
    # For RHEL8 or Centos 8
    sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    
  4. Install the PostgreSQL and Oracle instant clients repositories using the following command:

    sudo yum install pgdg-redhat-repo oracle-instant-clients-repo
    

    These repositories contain the rest of the dependencies required to run yb-voyager.

    Note that if you're using RHEL 8 or CentOS 8, perform the following two steps before proceeding to step 5.

    • Disable the default PostgreSQL yum module on your machine using the following command:

      sudo dnf -qy module disable postgresql
      
    • Install perl-open on your machine using the following command:

      sudo yum install perl-open.noarch
      
  5. Update the yum package manager and all the packages and repositories installed on your machine using the following command:

    sudo yum update
    
  6. Install yb-voyager and its dependencies using the following command:

    sudo yum install yb-voyager
    
  7. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

Perform the following steps to install yb-voyager using apt for Ubuntu:

Note

apt installation is only supported for Ubuntu 22. For other versions such as 18 and 20, use the install script via the Source installation option.
  1. Install the Yugabyte apt repository on your machine using the following command:

    wget https://s3.us-west-2.amazonaws.com/downloads.yugabyte.com/repos/reporpms/yb-apt-repo_1.0.0_all.deb
    sudo apt-get install ./yb-apt-repo_1.0.0_all.deb
    

    This repository contains the yb-voyager debian package and the dependencies required to run yb-voyager.

  2. Clean the apt-get cache and package lists using the following commands::

    sudo apt-get clean
    sudo apt-get update
    
  3. Install yb-voyager and its dependencies using the following command:

    sudo apt-get install yb-voyager
    
  4. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

Note on migrating from MySQL/Oracle on macOS

To migrate from MySQL/Oracle source databases on macOS to YugabyteDB, install yb-voyager using docker-based instructions.

Perform the following steps to install yb-voyager using brew for macOS:

  1. Tap the yugabyte Homebrew repository using the following command:

    brew tap yugabyte/tap
    

    The repository contains the formula to build and install yb-voyager on your macOS device.

  2. Install yb-voyager and its dependencies using the following command:

    brew install yb-voyager
    
  3. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

You can perform an airgapped installation on RHEL 7/8 and CentOS 7/8.

Install yb-voyager using a Docker image in an airgapped environment using the following steps:

  1. From a machine connected to the internet, run the following commands to pull and save the latest yb-voyager docker image (Pull the version from docker.io):

    docker pull yugabytedb/yb-voyager
    docker save -o yb-voyager-image.tar yugabytedb/yb-voyager:latest
    gzip yb-voyager-image.tar
    
  2. Download the yb-voyager wrapper script on the same machine using the following command:

    wget -O ./yb-voyager https://raw.githubusercontent.com/yugabyte/yb-voyager/main/docker/yb-voyager-docker
    
  3. Copy the yb-voyager-image.tar.gz and yb-voyager files to the airgapped machine.

  4. Load the docker image using the following command:

    gunzip yb-voyager-image.tar.gz
    docker load --input yb-voyager-image.tar
    
  5. Make the wrapper script executable and move it to the bin directory using the following commands:

    chmod +x yb-voyager
    sudo mv yb-voyager /usr/local/bin
    
  6. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

Package dependencies

To resolve package dependencies, yum takes into account the list of packages (and their versions) already installed on a machine.

For yum to download all the required dependencies, ensure that the list of all packages (and their versions) already installed on the airgapped machine and the connected machine are exactly the same. For example, it will not work if you prepare the installer bundle on RHEL 7.5 and try to install it on RHEL 7.2.

  1. Download rpm files for yb-voyager and its dependencies on a machine with internet connection using the following steps:

    1. Install the yugabyte yum repository on your machine using the following command:

      sudo yum install https://s3.us-west-2.amazonaws.com/downloads.yugabyte.com/repos/reporpms/yb-yum-repo-1.1-0.noarch.rpm
      

      This repository contains the yb-voyager rpm and other dependencies required to run yb-voyager.

    2. Install the epel-release repository using the following command:

      # For RHEL 7/CentOS 7
      sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
      
      # For RHEL 8/CentOS 8
      sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
      
    3. Install the PostgreSQL and Oracle instant clients repositories using the following command:

      sudo yum install pgdg-redhat-repo oracle-instant-clients-repo
      

      These repositories contain the rest of the dependencies required to run yb-voyager.

    4. If you're using RHEL 8 or CentOS 8, do the following:

      • Disable the default PostgreSQL yum module on your machine using the following command:

        sudo dnf -qy module disable postgresql
        
      • Download rpm files for perl-open on your machine using the following command:

        sudo yum install --downloadonly --downloaddir=<path_to_directory> perl-open.noarch
        
    5. Download the rpm files for yb-voyager and its dependencies using the following command:

      sudo yum install --downloadonly --downloaddir=<path_to_directory> yb-voyager
      
  2. Transfer the downloaded files to your airgapped machine.

  3. Navigate to the folder containing all the files and install the rpm files using the following command:

    sudo yum install *
    
  4. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

Before installing yb-voyager, ensure that you have the Docker runtime installed on your machine.

  1. Pull the docker image from YugabyteDB's docker hub (Pull the version from docker.io) as follows:

    docker pull yugabytedb/yb-voyager
    
  2. Download the script to run yb-voyager using the docker image from yb-voyager's GitHub repository, and move it to your machine's bin directory using the following commands:

    wget -O ./yb-voyager https://raw.githubusercontent.com/yugabyte/yb-voyager/main/docker/yb-voyager-docker && chmod +x ./yb-voyager && sudo mv yb-voyager /usr/local/bin/yb-voyager
    
  3. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

Perform the following steps to install yb_voyager using an installer script:

  1. Clone the yb-voyager repository.

    git clone https://github.com/yugabyte/yb-voyager.git
    
  2. Change the directory to yb-voyager/installer_scripts.

    cd yb-voyager/installer_scripts
    
  3. Install yb-voyager using the following script:

    ./install-yb-voyager
    

    It is safe to execute the script multiple times. If the script fails, check the /tmp/install-yb-voyager.log file.

  4. The script generates a .yb-voyager.rc file in the home directory. Source the file to ensure that the environment variables are set using the following command:

    source ~/.yb-voyager.rc
    
  5. Check that yb-voyager is installed using the following command:

    yb-voyager version
    

Next step