Note:

Migrate Data to Oracle Cloud Infrastructure Object Storage Using Rclone

Introduction

Oracle Cloud Infrastructure (OCI) Object Storage service is an internet-scale, high-performance storage platform that offers reliable and cost-efficient data durability. The Object Storage service can store an unlimited amount of unstructured data of any content type, including analytic data and rich content, like images and videos.

Rclone is a versatile command line program that synchronizes files and directories to and from various cloud storage providers or between on-premises to cloud. Rclone is an effective tool for migrating data to OCI Object Storage. It is known for its simplicity, efficiency, and wide support for numerous cloud services, including OCI Object Storage. Rclone supports the following features and use cases.

Rclone Architecture Overview

Rclone architecture works in two different use cases.

Audience

System administrators, application administrators, system and application owners, database owners, and developers who want to migrate data to OCI Object Storage.

Objective

Prerequisites

Task 1: Install Rclone on Windows

Note: If using Linux, skip to Task 2.

  1. Download and install Rclone latest version for Windows. For more information, see Rclone.

  2. Extract the file and add the extracted file to Windows system PATH environment variable for easy command line access.

Task 2: Install Rclone on Linux

  1. First method is to run a curl install script. Run the following curl command to download and install Rclone.

    curl https://rclone.org/install.sh | sudo bash
    

    Or

    Rclone install via precompiled binaries. Download the precompiled binary.

    curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip 
    or
    wget https://downloads.rclone.org/rclone-current-linux-amd64.zip
    

    Note: If you have used curl command to install the Rclone, then go to Task 3.

  2. Uncompress the binary and change to the binary directory.

    unzip rclone-current-linux-amd64.zip
    cd rclone-*-linux-amd64
    
  3. Copy the binary file to /usr/bin/ and set the permissions.

    cp rclone /usr/bin
    chown root:root /usr/bin/rclone
    chmod 755 /usr/bin/rclone
    
  4. Install the Rclone manpage.

    mkdir -p /usr/local/share/man/man1
    cp rclone.1 /usr/local/share/man/man1/
    mandb
    

    Image 4

Task 3: Configure Rclone for OCI Object Storage

  1. Open Oracle Linux CLI and run rclone config command. This command will start an interactive setup process.

    Image 5

  2. Create a new remote name for OCI Object Storage, type n in the menu, and then enter a new name for your OCI remote configuration (for example: oci-object-01).

    Image 6

  3. Choose the storage type, select the number corresponding to Oracle Cloud Infrastructure Object Storage 34.

    Image 7

  4. Choose the authentication provider to be utilized by Rclone. For example, we will utilize option 2.

    Image 8

  5. Enter the object storage namespace, object storage compartment ID, object storage region and the endpoint for object storage API.

    Image 9

    Note: Endpoint for object storage API is optional. Leave blank to use the default endpoint for the region.

  6. Enter the full path for the OCI config file and the config_profile information.

    Image 10

  7. The advanced config options are not required, select n to accept the default parameters.

    Image 11

  8. A summary of the Rclone configuration will be displayed, if everything looks right, select y to save the configuration.

    Image 12

  9. Perform a connection test to OCI Object Storage bucket before proceeding to migration and bulk data transfer activities with an rclone ls command.

    rclone ls OCIStorage:your-bucket-name
    

An Example Migration from a Local Linux directory

For this example, we are utilizing the /source directory as the local storage source in our Oracle Linux server, and an OCI Object Storage bucket named test-bucket as the target. Users on a Windows platform can follow along by creating a folder named source and creating files in the folder to copy to the OCI Object Storage bucket.

  1. We start with the empty OCI Object Storage bucket named test-bucket.

    Image 13

    Note: Buckets can be created with the OCI Console or OCI CLI.

  2. There are five text files in the /source directory.

    Image 14

    Note: You can create text files with the touch command or the editor of your preference such as vim. If you are using the Windows platform, you can create files using Notepad in a folder named source and continue using the rclone commands.

  3. Use the rclone copy command to transfer data from the /source folder on the Oracle Linux server to the OCI Object Storage bucket test-bucket.

    rclone copy /path/to/local/data OCIStorage:your-bucket-name
    

    For example:

    rclone copy /source/ oci:test-bucket
    
  4. From the OCI Console, go to the OCI Object Storage details page for the bucket named test-bucket. The bucket will now contain the text files migrated from the /source directory on the Oracle Linux server.

    Image 15

  5. Delete all files in the OCI Object Storage test-bucket with the rclone delete command.

    rclone delete oci:test-bucket
    
  6. The example command below includes advanced options such as multi-threaded streams, progress of the data transfer, buffer size, and so on. Explore Rclone advanced options to determine which options best suit your use case.

    rclone -vvv --progress --stats-one-line --max-stats-groups 10 --log-format date,time,UTC,longfile --fast-list --buffer-size 256Mi --oos-no-check-bucket --oos-upload-cutoff 10Mi --multi-thread-cutoff 16Mi --multi-thread-streams 3000 --transfers 3000 --checkers 64 --retries 2 --oos-chunk-size 10Mi --oos-upload-concurrency 10000 --oos-attempt-resume-upload --oos-leave-parts-on-error sync /root/source/ oci:test-bucket
    

    Note: Regularly update Rclone to utilize the latest features and improvements.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.