Switch to an alternate database

2 minute readReference

Use information in this topic to:

  • Switch from the built-in database to an alternate database.

    A CloudBees CD/RO enterprise license is required to configure an alternate database.
  • Switch from the current alternate database to a different alternate database.

For information about supported alternate databases, refer to Database requirements.

To change to the built-in database, refer to Switch from an alternate database to the built-in database.

The export and import commands are used to do perform the major tasks when migrating data from one database to the other. These are CloudBees CD/RO API commands to export/import database contents into an XML file.

CloudBees CD/RO supports Oracle JDBC connections using the SID or service name:

  • Using SID (Default):

    jdbc:oracle:thin:@<hostName>:<portNumber>:<sid>

  • Using the serviceName in the JDBC URL: The --customDatabaseUrl argument must be used to specify the full Oracle JDBC URL.

    --customDatabaseUrl <FullcustomDatabaseUrl>

    jdbc:oracle:thin:@//<hostName>:<portNumber>/serviceName

Switching databases

Disable server activities

Before you perform an export, ensure that the CloudBees CD/RO server is inactive — meaning that it cannot accept jobs — by completing the following actions on the server:

  1. Disable any active polling triggers and all project schedules.

    1. From the main menu, navigate to DevOps essentials  Triggers.

    2. In the Enabled column, disable any active triggers.

    3. From the main menu, navigate to DevOps essentials  Platform home page.

    4. Select Electric Cloud from the Projects tab.

    5. Select the Schedules tab and disable all schedules, including any polling triggers.

  2. Make sure all jobs are stopped.

    1. From the main menu, navigate to the Platform Home Page.

    2. Select the Jobs tab.

    3. Review the jobs list and take action to stop all jobs.

  3. Disable all resources so that no new job steps can run.

    1. From the main menu, navigate to the Resources list.

    2. Disable each resource by clearing its state from the Enabled column.

A quiescent database ensures a complete XML database file is exported.

Move the data

  1. Export your data from the existing database. This command can be run from any location with an ectool binary in /opt/cloudbees/sda/bin by default, but the file is stored on the CloudBees CD/RO server file system.

    ectool export <filename> --compress 1 --withAcls true --withNotifiers true
    If you don’t run the above command on the CloudBees CD/RO server, you must specify the server hostname:
    ectool --server <server_host> login <username> ENTER_PASSWORD_HERE ectool --server <server_host> export --compress 1 --withAcls true --withNotifiers true
    If CloudBees CD/RO is installed in a Kubernetes cluster, you must log in to a container in the flow-server pod to run the ectool export command. You can also run the ectool export command in a job step. If you run the command in a job step, you do not have to specify the server or sign in.
  2. Set the database configuration using the web interface or ectool. For more information, refer to Configure CloudBees CD/RO to use an alternate database.

  3. Restart the CloudBees CD/RO server:

    ectool shutdownServer --restart 1
  4. Import your data to the new database:

    ectool import <filename> --force 1
  5. Reverse steps taken in Disable server activities to enable server activities.