Skip to main content
Answer

Adding discovered SQL Server database content to subclient using the API

  • June 23, 2025
  • 6 replies
  • 104 views

Forum|alt.badge.img+2

Hi Community,

 

I am trying to figure out how to add the discovered SQL Servers to Subclient content using the API. Does anyone have any experience in how to do this? From what I could get my hands on, the API reference did not really specify this.

 

Let me know.

 

Thanks,
Daniel

Best answer by ddwyer

Hi Daniel,

 

Thanks so much for clarifying.

 

I am assuming the scenario is that you have a SQL client and you want to separate databases into multiple subclients under the discovered SQL instance? 

 

So in the scenario above, you could look at the MSSQL create-subclient and modify-subclient API reference pages depending on whether the subclient you’re adding content to exists or does not exist:

Content is defined in the content part of these API calls as per the below example:

 "content": [
{
"mssqlDbContent": {
"databaseName": "string"
}
}
],

 

If you are just planning on using the default subclient, then no further manual configuration is required. Default subclient automatically discovers databases at runtime during backup.


Let me know if this is what you’re looking for. 

 

David

6 replies

Forum|alt.badge.img+4
  • Vaulter
  • June 23, 2025

Hi Daniel,
 

I just want to clarify some terminology here because the question is not quite making sense to me (as a Commvault SQL guy).


With the SQL Server agent there is the server level, which is the top-level entity in Commvault (this could be a pseudo-client in the case of a cluster or AG configuration, or a stand-alone node). 

 

Attached to the server is the Instance (this is the actual SQL server service running on the machine), and then below this is the subclient.

 

With the SQL Server agent, the subclient defines content for data protection in the form of databases which are present on the server. 

When you say “...add the discovered SQL Servers to Subclient content...” are you asking about adding databases to a subclient using the API, or is this about something like the Virtual Server Agent (VSA) which protects the entire server?

 

David


Forum|alt.badge.img+2
  • Author
  • Byte
  • June 24, 2025

Hi David,

 

My bad, I guess I was a bit quick on the send button there.

I do mean adding databases to the content of the subclient using the API, not adding SQL servers to it.

 

Thanks,
Daniel


Forum|alt.badge.img+4
  • Vaulter
  • Answer
  • June 25, 2025

Hi Daniel,

 

Thanks so much for clarifying.

 

I am assuming the scenario is that you have a SQL client and you want to separate databases into multiple subclients under the discovered SQL instance? 

 

So in the scenario above, you could look at the MSSQL create-subclient and modify-subclient API reference pages depending on whether the subclient you’re adding content to exists or does not exist:

Content is defined in the content part of these API calls as per the below example:

 "content": [
{
"mssqlDbContent": {
"databaseName": "string"
}
}
],

 

If you are just planning on using the default subclient, then no further manual configuration is required. Default subclient automatically discovers databases at runtime during backup.


Let me know if this is what you’re looking for. 

 

David


Forum|alt.badge.img+2
  • Author
  • Byte
  • June 25, 2025

Hi David,

 

Thank you for your reply!

 

I have seen that you could change content with the endpoint you provided, thing is that during initial setup of a server client & subclient I did not think that the default subclient added all discovered databases to the content already.

And as the specific database names sometimes are unknown to me I previously have added them manually in the GUI by discovering and adding to the subclient.

So in summary, thank you for clarifying - this makes my life much easier!

 

Best,

Daniel


Forum|alt.badge.img+2
  • Author
  • Byte
  • June 25, 2025

Last question,

 

I am guessing this automatic discovery of content is valid for MySQL too?


Forum|alt.badge.img+4
  • Vaulter
  • June 26, 2025

Hi Daniel,

 

Thanks for marking the answer correct! 

 

Database discovery runs either when explicitly told to from the UI, or automatically when backup runs. 

 

The SQL Server agent does not have a background database discovery operation like many other agents employ, so the content tab of default subclient will often appear blank unless content is explicitly defined.

 

In relation to MySQL, I believe it uses a similar mechanism (my MySQL knowledge is definitely not where it should be), however the default subclient of most agents is used as a “catch-all” to pick up anything that is not otherwise defined in user-created subclients.

 

I hope this helps,

 

David