0
votes

I am working on project, where I need to copy the database from one cluster to another cluster in Azure data explorer. Is there any KQL query for this operation?

1

1 Answers

0
votes

You can achieve that using the a combination of the following control commands:

  1. .show database schema as csl script

    • Should be invoked on the cluster in which the source database exists.
  2. .execute database script

    • Should be invoked on the cluster in which the target database exists.

You'll need to copy the output of (1) as the script argument for (2).

For example:

.execute database script <|
   .alter database MyDB policy retention @'{"SoftDeletePeriod":"30.00:00:00","Recoverability":"Enabled"}'
   .alter database MyDB policy caching hotdata=time(12.00:00:00) hotindex=time(12.00:00:00)
   .create-merge table MyTable (a:string, b:int, c:string) 
   ... the rest of the output ...