Skip to main content

Hey all -

 

I am working with a customer and we have the command line backup for a SQL instance working just fine using an xml file.  What we can’t figure out is how do we do just 1 database on the instance?  We see the api call in command center but it doesn’t translate to the xml.  Anyone have the magic command?  We tried adding <databaseName>xxxx</databaseName> right under instance in the xml.

 

Attached a sample of the xml.

POST https://commserve/proxy/v2/sql/backup

 

{
  "backupType": "FULL",
  "instances": "
    {
      "sourceInstance": {
        "instanceId": 28,
        "instanceName": "SQL2\\PRODSQL2"
      },
      "selectedDatabases":
        {
          "databaseId": 160,
          "databaseName": "AppStudioDB"
        }
      ]
    }
  ]
}


@MFasulo  how does this translate to the xml?  We did see this in API equivalent but this doesn't give me what I need.

 


I see the challenge.  Let me dig a bit into this.   Is there a reason to force XML or can you use JSON?


He is calling command line from within SQL studio.  I do understand how the APIs work, but how do we do that from within SSMS?  The command line was pretty easy to get working using qoperation execute.

 


Hi Melissa,

try adding this section in the XML -  you will need to replace the variables below with your config.

-<sqlDatabaseAssociation>

<databaseId>5</databaseId>

<databaseName>CommServ</databaseName>
-<associatedSubclient>

<subclientName>default</subclientName>

<backupsetName>defaultBackupSet</backupsetName>

<instanceName>CS1\COMMVAULT</instanceName>

<appName>SQL Server</appName>

<clientName>CS1</clientName>

<displayName>CS1LAB</displayName>

<commCellName>CS1LAB</commCellName>

<csGUID>21320A30-5383-4248-BF3D-AD1478A6C05F</csGUID>

</associatedSubclient>

 

you can also do a “save as” script from the subclient to generate the XML.


@Gseibak  just getting back to this so we will try again!  Customer was doing a POC so we had tabled it.  We will also be working with Marcus so I’m pretty sure he will know the answer!

Hope all is well!


Reply