Move the artifact repository in Windows

2 minute readReference

In this scenario, the DATA directory definition in C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\wrapper.conf or C:/Program Files/cloudbees/sda/repository/bin/wrapper-windows-x86-64.exe (depending on where CloudBees CD/RO is installed) has these settings:

  • set.default.INSTALL_DIRECTORY=C:/cloudbees/sda

  • set.default.DATA_DIRECTORY=C:/cloudbees/sda

If the Windows server where the current artifact repository is stored is full and you want to move it to a new device with more disk space, map the artifact repository to a new network location.

In this procedure, the set.default.DATA_DIRECTORY value will change to the NEW_DATA_DIRECTORY value. The REPOSITORY_BACKING_STORE value in C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\server.properties will remain the same, relative to the DATA_DIRECTORY, which will be NEW_DATA_DIRECTORY.

In the example, the DATA_DIRECTORY will be changed to d:\ecdata, and the REPOSITORY_BACKING_STORE value will be relative to this directory.

The REPOSITORY_BACKING_STORE value is always relative to the DATA_DIRECTORY and cannot be set to a fully qualified absolute path.
  1. Publish the artifact under the current directory (C:\ProgramData\CloudBees\Software Delivery Automation\repository-data\<artifact_name>\<version>):

    ectool publishArtifactVersion --artifactName <artifact_name> --version <version> --fromDirectory <directory> --compress 0

    Example: To publish an artifact under the current directory ( C:\ProgramData\CloudBees\Software Delivery Automation\repository-data\jdoe\2001\1.0.0 ), enter:

    ectool publishArtifactVersion --artifactName "jdoe:2001" --version "1.0.0" --fromDirectory d:/temp/artest --compress 0

    The from Directory ( d:/temp/artest ) contains the files to be uploaded.

  2. Stop the repository server one of these ways:

    • Use the Windows service pane.

    • If you have admin user permissions, enter net stop CommanderRepository.

  3. Move the artifact repository data from the current /DATA_DIRECTORY directory to the /NEW_DATA_DIRECTORY directory using one of these methods:

    • Use Windows Explorer.

    • Enter move * <destinationDirectory> where the <destinationDirectory> is the /NEW_DATA_DIRECTORY directory.

      Example: To move the data to D:\ECDATA, enter move * d:\ecdata.

  4. In C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\wrapper.conf, change set.default.DATA_DIRECTORY=C:/ProgramData/cloudbees/sda to set.default.DATA_DIRECTORY=/NEW_DATA_DIRECTORY.

    Example: Change set.default.DATA_DIRECTORY=C:/ProgramData/cloudbees/sda to set.default.DATA_DIRECTORY=D:/ECDATA.

  5. Create a logs/repository/ subdirectory under the NEW_DATA_DIRECTORY using one of these methods:

    • Use Windows Explorer.

    • Enter the mkdir command as in the following example:

      Example: Create D:\ECDATA\logs\repository using the following commands.

      mkdir D:\ECDATA\logs
      mkdir D:\ECDATA\logs\repository
  6. Copy C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\server.properties and C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\keystore to the NEW_DATA_DIRECTORY/conf/repository directory using one of these methods:

    • Use Windows Explorer.

    • Enter the mkdir command as in the following example:

      Copy the directories to the /ECDATA/conf/repository using the following commands:

      mkdir /ECDATA/conf
      mkdir /ECDATA/conf/repository
      copy C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\ server.properties D:\ECDATA\conf\repository\
      copy C:\ProgramData\CloudBees\Software Delivery Automation\conf\repository\ keystore D:\ECDATA\conf\repository\
  7. Start the repository server using Windows Service pane.

  8. Check if CloudBees CD/RO has started using the artifact repository in the new network location:

    netstat -aon | find “8200”

    Example:

    C:\windows\system32> netstat -aon | find "8200"
    TCP 0.0.0.0:8200 0.0.0.0:0 LISTENING 22868

    This shows that the DATA_DIRECTORY repository has moved to D:\ECDATA.

    The repository service.log, repository.log and repository.pid files will be created in the D:\ECDATA \logs\repository directory.

  9. Publish a new artifact and check if it is published:

    ectool getArtifactVersions | grep artifactVersionName