Skip to main content
How to deploy Knowledge articles
Valerio Chang avatar
Written by Valerio Chang
Updated over 3 months ago

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.

Note: Due to a quirk in how Salesforce stores and retrieves rich text fields, you are not able to deploy knowledge articles that include pictures in the rich text field. Any text that is written after the first picture in the article will not be deployed

Enablement

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 Knowledge user

  • You have Enable Lightning Knowledge

Metadata 

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.


Data 

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 __kav object.)

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.

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 organization then by default the currently published version of the article is the one that will be deployed. This is because Salesforce recognizes 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.

Click Configure Deployment.

Select knowledge_kav

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 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.

Troubleshooting

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 queryable and updatable must be true.

If you're still having trouble deploying Knowledge articles, please get in touch.

Did this answer your question?