# Retrieve the Deployment Framework from source control

If there’s a managed version of the Caplin Platform Deployment Framework that’s been added to a source control system, you can set it up on another machine, typically by following these steps:

<dl><dt><strong>💡 TIP</strong></dt><dd>

In the following steps you’ll be using the `dfw` command of the Deployment Framework. Before entering any `dfw` command as `./dfw <command-name>`, make sure your current (working) directory is set to the Deployment Framework’s topmost directory.

For a list of `dfw` commands, [click here](cdf-the-deployment-framework-command-utility-dfw.md).
</dd></dl>

**💡 TIP**\
When the Deployment Framework is in use, new files are created by running the Framework commands, such as `./dfw deploy`, `./dfw (de)activate`, `./dfw dump`, and `./dfw start`. Your source control system might detect such new files and ask you if they should be added to source control: always reply NO, since none of these files should ever be added in this way.

## Prequisites

Make sure you’ve installed Java on the target machine (see [Installing Java](cdf-installing-the-deployment-framework.md#installing-java) in [Installing the Deployment Framework](cdf-installing-the-deployment-framework.md)).

If the target machine runs Windows, make sure you’ve you’ve installed Cygwin (see [Installing Cygwin](https://cygwin.com/install.html)).

## If the target machine doesn’t already have the Deployment Framework installed

1. On the target machine, retrieve the Deployment Framework files from your source control system.

   <dl><dt><strong>📌 NOTE</strong></dt><dd>

   On Windows, retrieve the files under Cygwin with the environment variable `CYGWIN` set to `winsymlinks`:

   ```
   export CYGWIN=winsymlinks
   ```

   This ensures that the links are created as Windows shortcuts.
   </dd></dl>

   **📌 NOTE**\
   On Windows XP and Windows 7, always install the Deployment Framework at the highest directory level possible, preferably at the root (for example, at _C:\&lt;short_folder_name>_). Windows XP has a 259 character limit on file path names (of which 3 characters are reserved for the drive letter and initial _\_ character), so if the Framework is deployed at a deeper level, some files may not be created when other kits are deployed to the Framework.
2. If no kits are included in the copy of the Framework that’s under source control (for example, Liberator, Transformer, Caplin-supplied blades and locally developed blades), copy any kits you need into the Framework’s _kits_ directory.
3. Run the command `./dfw deploy`

   This deploys the Framework and any Liberator, Transformer and blade kits that are in the _&lt;Framework-root>/kits/_ directory, and then moves the kits to the _kits/archive/_ directory.
4. Update the configuration settings in _&lt;Framework-root>/global_config/overrides/_ as required (for example, if you need to change the ports used by Liberator and/or Transformer). See:
   * How can I... [Change server-specific configuration](cdf-change-server-specific-configuration.md)
   * How can I... [Change Liberator and Transformer port numbers](cdf-change-liberator-and-transformer-port-numbers.md)
   * How can I... [Change a blade’s configuration](cdf-change-a-blades-configuration.md)

## If the target machine already has a version of the Deployment Framework installed

1. On the target machine, run the command `./dfw stop` to stop the current copy of the Framework.
2. Retrieve the Deployment Framework files from your source control system.

   <dl><dt><strong>📌 NOTE</strong></dt><dd>

   On Windows, retrieve the files under Cygwin with the environment variable `CYGWIN` set to `winsymlinks`:

   ```
   export CYGWIN=winsymlinks
   ```

   This ensures that the links are created as Windows shortcuts.
   </dd></dl>
3. Merge the contents of the files in the new Framework’s _&lt;Framework-root>/global_config/_ directory with the equivalent files on the target machine, so that your existing local settings are preserved.
4. Run the command `./dfw deploy`

   This deploys the Framework and any Liberator, Transformer and blade kits that are in the _&lt;Framework-root>/kits/_ directory, and then moves the kits to the _kits/archive/_ directory.

   **📌 NOTE**\
   Running `./dfw deploy` moves any kits in the Framework’s _kits_ directory into the _kits/archive_/ directory.

---

**See also:**

* [Add the Deployment Framework to source control](cdf-add-the-deployment-framework-to-source-control.md)
* [Add a blade to source control](cdf-add-a-blade-to-source-control.md)
* [Retrieve a blade from source control](cdf-retrieve-a-blade-from-source-control.md)
