Moving the Artifact Repository in Windows

In this scenario, the DATA directory definition in C:\ProgramData\Electric Cloud\ElectricCommander\conf\repository\wrapper.conf or C:/Program Files/ElectricCloud/ElectricCommander/repository/bin/wrapper-windows-x86-64.exe (depending on where CloudBees Flow is installed) has these settings:

  • set.default.INSTALL_DIRECTORY=C:/ElectricCloud/ElectricCommander

  • set.default.DATA_DIRECTORY=C:/ElectricCloud/ElectricCommander

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\Electric Cloud\ElectricCommander\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. The solution in http://ask.cloudbees.com/questions/2192/how-to-configure-which-directory-the-artifact-repository-uses will not work until you change the DATA_DIRECTORY as described in this procedure.
  1. Publish the artifact under the current directory ( C:\ProgramData\Electric Cloud\ElectricCommander\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\Electric Cloud\ElectricCommander\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\Electric Cloud\ElectricCommander\conf\repository\wrapper.conf, change set.default.DATA_DIRECTORY=C:/ProgramData/ElectricCloud/ElectricCommander to set.default.DATA_DIRECTORY=/NEW_DATA_DIRECTORY.

    Example: Change set.default.DATA_DIRECTORY=C:/ProgramData/ElectricCloud/ElectricCommander 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\Electric Cloud\ElectricCommander\conf\repository\server.properties and C:\ProgramData\Electric Cloud\ElectricCommander\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\Electric Cloud\ElectricCommander\conf\repository\
      server.properties D:\ECDATA\conf\repository\
      copy C:\ProgramData\Electric Cloud\ElectricCommander\conf\repository\
      keystore D:\ECDATA\conf\repository\
  7. Start the repository server using Windows Service pane.

  8. Check if CloudBees Flow 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
Copyright © 2010-2020 CloudBees, Inc.Online version published by CloudBees, Inc. under the Creative Commons Attribution-ShareAlike 4.0 license.CloudBees and CloudBees DevOptics are registered trademarks and CloudBees Core, CloudBees Flow, CloudBees Flow Deploy, CloudBees Flow DevOps Insight, CloudBees Flow DevOps Foresight, CloudBees Flow Release, CloudBees Accelerator, CloudBees Accelerator ElectricInsight, CloudBees Accelerator Electric Make, CloudBees CodeShip, CloudBees Jenkins Enterprise, CloudBees Jenkins Platform, CloudBees Jenkins Operations Center, and DEV@cloud are trademarks of CloudBees, Inc. Most CloudBees products are commonly referred to by their short names — Accelerator, Automation Platform, Flow, Deploy, Foresight, Release, Insight, and eMake — throughout various types of CloudBees product-specific documentation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Jenkins is a registered trademark of the non-profit Software in the Public Interest organization. Used with permission. See here for more info about the Jenkins project. The registered trademark Jenkins® is used pursuant to a sublicense from the Jenkins project and Software in the Public Interest, Inc. Read more at www.cloudbees.com/jenkins/about. Apache, Apache Ant, Apache Maven, Ant and Maven are trademarks of The Apache Software Foundation. Used with permission. No endorsement by The Apache Software Foundation is implied by the use of these marks.Other names may be trademarks of their respective owners. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this content, and CloudBees was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this content, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.