Migrating from v4
Introduction
If you're currently running a Dependency-Track v4 deployment, don't worry!
We're aiming to provide tooling and guides on how to migrate to v5 once it reaches general availability. The goal is to offer tools that perform the migration automatically, with little to no manual effort (except the provisioning of infrastructure of course).
Tip
Follow https://github.com/DependencyTrack/hyades/issues/881 for updates on this topic.
Running v4 and v5 in parallel
Given an existing production deployment of v4, it can be helpful to run a v5 test deployment in parallel, to compare behavior and testing new features on real data.
This can be achieved by leveraging notifications, in particular BOM_PROCESSED
notifications.
They are emitted by Dependency-Track after a BOM's contents are synchronized with the database.
The subject of BOM_PROCESSED
notifications contains the original BOM that way uploaded, encoded in Base64.
It also contains the name and version of the project it was uploaded to. This information is sufficient to
construct a BOM upload request, that can be submitted to another Dependency-Track instance.
All that's needed is an application that can:
- Receive Webhooks, and parse the JSON payload within them
- Perform a mapping from notification subject, to BOM upload request
- Forward the BOM upload request to another Dependency-Track instance
This can, of course, be scripted. However, we recommend using Bento, which reduces it all to a single config file.
Tip
You can use the same approach outlined here to construct a pre-prod / staging environment.
Conceptually, this is what the setup will accomplish:
sequenceDiagram
Client->>DT v4: Upload BOM<br/>PUT /api/v1/bom
DT v4->>DT v4: Validate and<br/>Process
DT v4->>Bento: Notification<br/>BOM_PROCESSED
Bento->>Bento: Map to BOM<br/>upload request
Bento->>DT v5: Upload BOM<br/>PUT /api/v1/bom
DT v5->>DT v5: Validate and<br/>Process
Creating API Key
In order to upload BOMs to the Dependency-Track v5 system, an API key with BOM_UPLOAD
and PROJECT_CREATION_UPLOAD
permissions is required. Log into your Dependency-Track v5 instance, navigate to Administration -> Access Management
-> Teams, and create a new team with accompanying API key:
Deploy Bento
Bento works with the concept of pipelines, which are configured via YAML.
The following pipeline will achieve the desired outcome:
Refer to the respective pipeline component's documentation for more details:
Run Bento as container:
Configure Notification
Log into your Dependency-Track v4 instance, navigate to Administration -> Notifications -> Alerts, and create a new alert with the following settings:
- Scope: Portfolio
- Notification level: Informational
- Publisher: Outbound Webhook
Once created, enable BOM_PROCESSED
under Groups, and configure the URL of your Bento endpoint as Destination:
Testing
- Upload a BOM to a project in your Dependency-Track v4 instance.
- Head over to your Dependency-Track v5 instance and wait for the upload to replicate.
If all goes well, you're done! Happy testing!
Tip
If the BOM upload does not replicate:
- Check the logs of your Dependency-Track v4 deployment for any errors during notification publishing.
- Check the logs of Bento for any errors or warnings.
- Check the logs of your Dependency-Track v5 deployment for any errors during BOM processing.
- Ensure that the API key you created has the correct permissions.
- Ensure that Bento is reachable from your Dependency-Track v4 deployment.
- Ensure that your Dependency-Track v5 deployment is reachable from Bento.