Migrating the Smart Hub and Redis Server data


If you want to use a different Smart Hub or Redis Server or both, you must migrate data from the existing Smart Hub and embedded Redis Server. TrueSight Server Automation provides the out-of-the-box migration script that enables you to smoothly migrate this data. 

Important

Migration scenarios

The following scenarios are supported:

Scenario

Perform these steps

Instructions

You are using Smart Hub 20.02 or 20.02.01 on a Windows system, and you want to upgrade Smart Hub and Redis Server to the latest version.

  1. Migrate the embedded Redis Server data to the external Redis Server that the existing Smart Hub supports.
  2. Configure the external Redis Server to use the migrated data.
  3. Configure the Smart Hub to use the new Redis Server.
  4. Upgrade Smart Hub to 21.02.

You are using Smart Hub 20.02 or 20.02.01 on a Windows or a Linux system. You now want to use a different Smart Hub and Redis Server.

  1. Export the existing Smart Hub and Redis Server data.
  2. If you are using the Smart Hub with the embedded Redis Server on a Linux system, import both the Smart Hub and Redis Server data.
  3. If you are using an external Redis Server, import the Smart Hub data and Redis Server data separately.

Prerequisites

Make sure to download the migration script from EPD. The migration script is packaged with the Smart Hub installer. For more information, see Downloading-the-installation-files

Migrating the Redis Server data 

Redis Server is not packaged with Smart Hub 21.02 on a Windows system. Therefore, before you upgrade Smart Hub to 21.02, you must migrate data from the embedded Redis Server to an external Redis Server. Also, make sure that you also upgrade the Application Server to 21.02. For instructions, see Upgrading the Application Server.

Do the following:

  1. Log in to the server where the existing Smart Hub is installed. 
  2. Copy SmartHub_data_migration script to a temporary directory.
  3. Navigate to the same directory.
  4. Do the following to export data from the embedded Redis Server.
    1. Run the migration script:
      • (WindowsSmartHub_data_migration.bat
      • (LinuxSmartHub_data_migration.sh
    2. When prompted to import data, type n and press Enter.
    3. When prompted to export data, type y and press Enter.
    4. When prompted to select a component, type 1 to select Redis Server and press Enter.
      The exported data is added to the Redis_Data.zip file that is created at the Smart Hub installation path:
      • (WindowsC:\Program Files\BMC Software\SmartHub
      • (Linux/opt/bmc/bladelogic/SmartHub
  1. Log in to the Linux host where the external Redis Server is installed.
  2. Copy the SmartHub_data_migration script and Redis_Data.zip files to a temporary directory.
  3. Navigate to the same directory.
  4. Do the following to import the embedded Redis Server data.

    1. Run the migration script:
      • (WindowsSmartHub_data_migration.bat
      • (LinuxSmartHub_data_migration.sh
    2. When prompted to import data, type y and press Enter.
    3. When prompted to select a component, type 1 to select Redis Server and press Enter.

    Important

    The import process overwrites the existing data. Make sure that you back up the existing data or use a dedicated Redis Server.

  5. Configure the Redis Server:
    1. Navigate to the following directory:
      <installation_directory_of_redis>/redis.conf
    2. In a text editor, open redis.conf and configure these properties:

      "dbfilename":"redisdb.rdb",
      "appendonly":"yes",
      "appendfsync":"always",
      "auto-aof-rewrite-min-size":"1gb",
      "dir":"<path to the Data folder that contains migrated data>",
      "bind":"<IP address of the Linux system>"
    3. Save the changes.
  6. Do the following to change the Redis Server host in the existing Windows Smart Hub:
    1. Log in to the system where the Smart Hub is installed.
    2. Run the following command to stop the Smart Hub service. For details, see Managing-the-Smart-Hub.
    3. Navigate to the following path:
      <installation_directory>/smarthub/config
    4. Open config.json and update the Linux Redis Server details:

      "elasticCacheAddress": "<linux_redis_server_host_name>"
      "elasticCachePort": <linux_redis_port>
    5. Run the following command to start the Smart Hub service. For details, see Managing-the-Smart-Hub.
  7. Upgrade Smart Hub to 21.02. For instructions, see Upgrading the Smart Hub.

Migrating the Smart Hub and Redis Server data 

If you want to use a new Smart Hub and Redis Server, you need to migrate data from the existing Smart Hub and Redis Server. You can migrate data to:

  • The Smart Hub with the embedded Redis Server installed on a Linux server
  • The Smart Hub and external Redis Server installed on separate Linux servers

You can use the DNS name of the existing Smart Hub for the new Smart Hub, which eliminates the need to register the Smart Hub and configure Smart Agents. To do so, contact your network administrator.

Do the following:

  1. Log in to the host where your existing Smart Hub is installed.
  2. Copy SmartHub_data_migration script to a temporary directory.
  3. Navigate to the same directory.
  4. Export the Smart Hub and Redis Server data:
    1. Run the migration script:
      • (WindowsSmartHub_data_migration.bat
      • (LinuxSmartHub_data_migration.sh
    2. When prompted, specify that you want to export all data that includes data of Smart Hub, Smart Hub Gateway, and Redis Server.
      The exported data is added to the SmartHub_Data.zip and Redis_Data.zip files.
  5. If you are using the Smart Hub with the embedded Redis Server on a Linux system, do the following:
    1. Log in to a Linux system where the new Smart Hub is installed.
    2. Copy the SmartHub_data_migration scriptSmartHub_Data.zip, and Redis_Data.zip to a temporary directory.
    3. Navigate to the same directory.
    4. Import the Smart Hub and Redis Server data.

      1. Run the migration script:
        SmartHub_data_migration.sh
      2. When prompted to import data, type y and press Enter.
      3. When prompted, type A to specify that you want to import both the Smart Hub and Redis Server data.

      If you assigned the same DNS name for the new Smart Hub host, your data migration is now complete. Otherwise, go to step 7.

  6. If you are using an external Redis Server, do the following:

    Important

    A Redis server being used for an already running Smart Hub instance cannot be used for other Smart Hub instances. You need to have a separate Redis server instance.

    1. Import the Redis Server data:
      1. Log in to the Linux system where the external Redis Server is installed.
      2. Copy the SmartHub_data_migration script and Redis_Data.zip to a temporary directory.
      3. Navigate to the same directory.
      4. Import the Redis Server data.
        1. Run the migration script:
          SmartHub_data_migration.sh
        2. When prompted to import data, type y and press Enter.
        3. When prompted, type 1 to specify that you want to import the Redis Server data.
    2. Import the Smart Hub data:
      1. Log in to the Linux system where the new Smart Hub is installed.
      2. Copy the SmartHub_data_migration script and SmartHub_Data.zip to a temporary directory.
      3. Navigate to the same directory.
      4. Import the Smart Hub data.
        1. Run the migration script:
          SmartHub_data_migration.sh
        2. When prompted to import data, type y and press Enter.
        3. When prompted, type 2 to specify that you want to import the Smart Hub data.
  7. If a different DNS name is used for the new Smart Hub, do the following:
    1. Register the new Smart Hub in the Application Server. For details, see Configuring-the-Smart-Hub-and-Smart-Hub-Gateway.
    2. Update the Smart Agent configuration properties to establish Smart Agent communication with the new Smart Hub:

      1. Log in to the system where the RSCD Agent is installed.
      2. Navigate to the following path:
      • (Windowsc:\windows\rsc
      • (Linux/etc/rsc
      1. Open the smartagent.conf file, and edit the following properties:

        rest_api":{
        "
        host":"<new_smarthub_host>",
        "
        port":<new_smarthub_port>,
      2. Save the changes.
      3. Restart the Smart Agent. For details, see Managing-the-Smart-Agent.
      4. Repeat these steps for the other targets where the RSCD and Smart Agents are installed.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*