Switching to an Alternate Database from the Built-In Database

2 minute read

If you did not deselect the “database” check box during installation, you can switch to another database at any time. You can use this procedure to switch from the built-in database or to switch from the current alternate database to a different alternate database.

If you are using two different CloudBees Flow servers in a non-HA configuration, they cannot point to the same database.

The export operation is run by the server process, not through ectool. The command is not run by the agent, but by the server itself. Therefore, it has some impact if the server agent service user and the server service user are different. For example, the following commands in the same step are executed by two different users:

mkdir ("/path/foo");$ec->export("/path/foo/project.xml",{path=>"/projects/MYPROJ"});

The /path/foo directory creation is executed by the agent service, which means that the agent user needs permission to create the directory. The export is executed by the CloudBees Flow service user.

Use these procedures to configure a new database and migrate the existing data.

Preventing Database Changes During the Export

Before you perform an export, ensure that the CloudBees Flow server is inactive (meaning that it cannot accept jobs) by completing the following steps on the server:

  1. Disable ElectricSentries.

  2. Disable project schedules.

  3. Check that no jobs are running on any resources.

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

This ensures a complete XML file by preventing changes to the CloudBees Flow database during the export.

Exporting and Importing Your Data

  1. Export your data by entering the following command:

    ectool export <filename> --compress 1

  2. Set the database configuration using the web interface or ectool. For more information, see Configuring CloudBees Flow to Use an Alternate Database .

  3. Restart the CloudBees Flow server by entering the following command:

    ectool shutdownServer --restart 1

  4. Import your data by entering the following command:

    ectool import <filename> --force 1