Hero Backgroud Elements 2
Reading Time: 2 Min

Replicate data from on-premise to the cloud with the Cloud Connector

Learning Article
  • In this article, you will learn how to use the SAP Connectivity Service to connect an SAP HANA on-premise database to an SAP HANA Cloud database to replicate data from SAP HANA on-premise to the cloud database. This includes setting up the cloud connector in your on-premise database, which allows you to set up a connection to a remote source that does not require the installation and configuration of the Data Provisioning Agent.

    This connection is a convenient choice if you want to quickly replicate data from an on-premise database to SAP HANA Cloud database.

     

    You have an SAP HANA on-premise database but no production instance of SAP HANA Cloud and would like to try out the SAP Connectivity Service? This service is available in the free trial of SAP HANA Cloud! Sign up now.

    What is the Cloud Connector?

    The cloud connector is a component for on-premise databases that serves as a link between SAP HANA Cloud and other SAP Business Technology Platform applications. It lets you easily connect and expose specific parts of an on-premise database without having to expose the entire on-premise landscape. It gives you fine-grained control and helpful features for business-critical scenarios, like recovering broken connections automatically and running in a high-availability setup.

    The cloud connector offers you several advantages. For example, installation and configuration are easy as, for example, you do not have to configure an on-premise firewall for allowing access to an on-premise system.

    Now let us look at the steps you need to take to install and set up cloud connector.

    The steps described in this article require…

    • …an SAP HANA on-premise database with SPS05 or higher if you want to use Remote Table Replication. If you have HANA express edition SPS04 Rev45, however, you may still use the cloud connector for SDA virtual access.
    •  …a running instance of an SAP HANA Cloud, HANA database (trial or production).

    Now let us look at the steps you need to take to install and configurate the Cloud Connector, which you will learn how to do throughout this article:

    1. Enabling the Connectivity Service for SAP HANA Cloud
    2. Installing and configuring the cloud connector
    3. Establishing a remote source to replicate data from SAP HANA on-premise to SAP HANA Cloud
    Next Section: Enabling the Connectivity Service for SAP HANA Cloud
  • How to enable the Connectivity Service for SAP HANA Cloud

    First, you need to enable the Connectivity Service in the SAP HANA Cloud, HANA database you want to connect to an on-premise database.

    You can do so either when provisioning a new instance or by editing an already existing instance.

    Option 1: Enable the Connectivity Service during the provisioning of a database

    1. Open SAP BTP Cockpit and enter your (trial) account.
    2. Enter your Global Account, Subaccount and then space.
    3. There, click on SAP HANA Cloud on the left side menu.
    4. Click on Create Database.
    5. The wizard will navigate you through the steps necessary to create your instance. If you are unsure how to provision the instance, you can read our learning article here.
    6. In step 3 of the process (SAP HANA Advanced Settings), you can specify what IP addresses you allow or deny. Below, you can see the option to enable or disable the SAP Cloud Connector.
    7. Click on Enable and select what IP addresses you would like to allow.
    8. Finish the rest of the settings and click on Create Instance.
    9. Your instance will be created and it is ready to be connected with the cloud connector.

    Option 2: Enable the Connectivity Service in an existing instance

    1. Open SAP BTP Cockpit and enter your (trial) account.
    2. Enter your Global Account, Subaccount and then space.
    3. Navigate to the tile of the instance you want to connect to an SAP HANA on-premise database.
    4. Click on Actions on the bottom right corner of the tile.
    5. Select Monitor database. SAP HANA Cloud Central will open in a new tab.
    6. There, click on the three dots in the Actions column on the right side of the screen.
    7. Select Edit.
    8. In the wizard that opens, scroll down to the section Connections.
    9. Click on Enable.
    10. Click on Save.
    11. Your instance is now enabled and ready to be connected with the cloud connector.

    Now that you have enabled the Connectivity Service for SAP HANA Cloud, it is time to install the cloud connector and configure it. Learn in the next section how to do that.

    Prev Section Next Section: Installing and configuring the Cloud Connector
  • How to install and configure the Cloud Connector

    1. Install the cloud connector. You can download it from here. Check the system requirements for different operating systems as well as additional setup recommendations in the technical documentation here.
    2. Once the download and installation are finished, open a web browser to administer the Cloud Connector. You can find the supported browsers here.
    3. In a web browser, enter:
      https://localhost:8443

       

    4. 8443 is the default port specified during installation. If you have installed the cloud connector to a different machine than your local one, enter its hostname instead of the default port.
    5. On the logon screen that opens, enter this statement and include your credentials (case sensitive):
      Administrator / manage for <User Name> / <Password>

       

    6. When you first log in, you need to change the password.

     

    Define the subaccount

    1. In the Cloud Connector Administration, you can see at the top of the screen that it will not work before you define a subaccount. You need to define the subaccount to map the cloud connector to the subaccount that your SAP HANA Cloud instance you want to connect is located in.
    2. Select the region of the subaccount.
    3. In the field Subaccount, you need to enter the subaccount ID.
    4. To obtain it, go to SAP BTP Cockpit and navigate to your subaccount. If you still have SAP BTP Cockpit open from the steps of enabling the Connectivity Service, you can get there by clicking on the name of your subaccount in the top panel of the screen.
    5. Copy the subaccount ID from the top of the screen and enter it in the field Subaccount in the cloud connector.
    6. Optionally, you can enter a display name
    7. Login in with the credentials of the subaccount on SAP BTP Cockpit.
    8. If your subaccount is not on Cloud Foundry these steps vary slightly: You need to fill in the technical Subaccount name, subaccount user name and password.
    9. Enter a location ID and note it for later as you will need this information to set up a remote source.
    10. Click on Save.

     

    Connect the Cloud Connector to your SAP HANA on-premise system

    1. After the configuration has finished, click on Cloud To On-Premise on the left panel.
    2. There, click on the plus icon in the top right corner to add a new mapping that will map your SAP HANA on-premise system to the cloud connector.
    3. A wizard opens. There, from the drop-down menu Back-end Type, select SAP HANA.
    4. Click on Next.
    5. For the Protocol, select TCP from the drop-down menu.
    6. In the next step, enter the internal host information and internal port of your on-premise system.
    7. To expose your internal host to the public network, you need to next specify the virtual host and virtual port. Here, it is recommended to use a host name that is different from your internal host name. The port can stay the same.
    8. Click on Next. You can optionally add a description to this mapping or skip that step.
    9. Check the summary shown and click on Finish.
    10. Your internal system name is now mapped to your virtual host name.
    11. In the column Check Result, it still says Unchecked.
    12. To check it, click on the looking glass icon on the right.
    13. The status will change to Reachable. Now the cloud connector can reach your SAP HANA on-premise system.
    14. Congratulations, you have now configured the cloud connector and you are ready to use this connection.
    15. For further details on configurating the cloud connector, please refer to the technical documentation.

    Now you have successfully installed and configured the cloud connector. Only one more step is needed to replicate data from the on-premise database to the SAP HANA Cloud, HANA database. Learn in the last section how to establish a remote source using the connection you have just created.

    Prev Section Next Section: Establishing a remote source
  • How to establish a remote source from SAP HANA Cloud to SAP HANA on-premise

    In your SAP HANA Cloud, HANA database instance, you can now create a remote source between this instance and the on-premise database.

    1. Open the SAP HANA Database Explorer connected to your SAP HANA Cloud instance.
    2. Open a SQL console of your instance.
    3. With this statement, you can create a remote source from SAP HANA Cloud to SAP HANA on-premise to then replicate data from the on-premise system to the cloud.
      CREATE REMOTE SOURCE <NAME> ADAPTER "hanaodbc"
      CONFIGURATION 'ServerNode=<virtual_host_name:portnumber>;use_haas_socks_proxy=true;scc_location_id=<locationid>'
      WITH CREDENTIAL TYPE 'PASSWORD' USING 'user=<username>;password=<password>';

       

    4. In that statement, you need to add the host name and port number of the virtual host that you have manually created in the cloud connector. The reason for this is to not reveal the actual hostname and port which might be a breach in security.
    5. For on-premise connections, the socks proxy needs to be specified, which is already included in this statement.
    6. Next, in that statement, add the cloud connector location id, which you specified in the beginning.
    7. Running this statement will create a remote source from SAP HANA Cloud to your on-premise system.
    8. The remote source will be established and you can create virtual tables and use Remote Table Replication just like when connecting different SAP HANA Cloud instances. Please note that you are only able to use Remote Table Replication if you are using SAP HANA on-premise SPS05 or higher, otherwise, only SDA virtual access is available.

    And now you know how to install and configure the cloud connector to replicate data from an SAP HANA on-premise database to SAP HANA Cloud.

    Make sure to check out our detailed learning tracks on related topics, for example:

    Prev Section Completed