Knowledge articles are composed of metadata and data components, and Gearset can help you deploy parts of them to your target orgs. As with any data records in Salesforce, make sure you deploy the metadata to the target before migrating the data records.
Gearset is able to deploy knowledge articles with rich text and large image files. If you encounter any issues during the process, please get in touch with us.
If the Knowledge Articles don't already exist in the target org, then before starting the migration you'll need to make sure the following settings are checked:
Your user is a
Enable Lightning Knowledge
Knowledge articles are considered to be the
Custom object metadata type. You can select
Knowledge__kav and deploy them to the target, just like any other metadata.
Knowledge articles appear in the comparison results as
Custom objects, as shown in the screenshots below:
Once the metadata deployment is done, you'll see that nothing will appear yet on the UI in the target org. We'll need to deploy the data next.
To deploy Knowledge data records with Gearset, you can follow the data deployment workflow. (Learn more about our data loader here.)
Below is an example of what we want to deploy:
Using the Gearset data loader, you can migrate the Knowledge articles over to the target org. In this example, you should select the
knowledge__kav object. (If you're interested in migrating other article types, look for the corresponding
Follow through the rest of the data deployment to move the articles across to your target org:
Once the articles are deployed, they will appear as DRAFT in the target org, ready for you to publish in your target org.
All of your rich text formatting and embedded images will be preserved as part of the deployment - this is an example of the article we deployed above as it appears in the target org.
Deploying article versions
As stated in the previous section, when an article is deployed it will by default be in a draft state when it reaches the target.
Drafts have the version number 0, until they are published.
If you have multiple versions of an article in the source organisation then by default the currently published version of the article is the one that will be deployed. This is because Salesforce recognises that article as the active version.
To choose a specific version of the article you would like to deploy, you need to identify the record id of that version, and use it for filtering.
The following is an example of this process:
I have made some formatting changes to my article, and now want to deploy Version 2 of this article to the target.
Navigate to https://app.gearset.com/configure-data and choose the source and target for the deployment.
Now what we need to do is filter for our article - in the previous example we filtered using a specific record Id. We're going to do that again.
After navigating to the specific article version I want to deploy, I can select the record Id from the URL.
Filter for the record Id, Gearset will automatically query your source org and and tell you how many records match that filter.
You can see on this screen that the result of that query is that only 1 record matched.
Continue on with your data deployment as normal, and deploy the data to the target.
Once that data deployment has completed you can check the target org to confirm that deployment has been successful.
We can see that the formatting changes have been successfully deployed into the target org - and the article is in a draft state as we'd expect.
Because the article becomes a draft version automatically in the target the version number is not preserved, which is important to bear in mind when deploying new article versions.
To deploy Knowledge article data:
The data loader (data deployment) feature in Gearset needs to have been purchased and enabled by your team owner.
The Knowledge object metadata type needs to exist on both the source and target.
The user running the deployment needs to have permission to access the Knowledge objects.
The attributes of the Knowledge object need to allow Gearset to read and write to them, i.e. the values of
updateablemust be true.
If you're still having trouble deploying Knowledge articles, please get in touch.