cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to export a Databricks repos in dbc format with databricks CLI

RantoB
Valued Contributor

Hi,

How can I export a Databricks repository in dbc format with databricks CLI ?

It is possible to make

databricks workspace export_dir path/to/dir .

but not

databricks repos export_dir path/to/dir .

Thanks for you answers

1 ACCEPTED SOLUTION

Accepted Solutions

Prabakar
Esteemed Contributor III
Esteemed Contributor III

@Bertrand BURCKER​  Is your requirement to do it only from the CLI? Or to export the repos?

If it is to export the repos, you can export it as DBC format from the UI.

image

View solution in original post

8 REPLIES 8

Prabakar
Esteemed Contributor III
Esteemed Contributor III

Hi @Bertrand BURCKER​ the repos cli does not support the export command.

Below are the supported commands by repos.

Commands:

create -- Creates a repo.

delete -- Deletes a repo.

get -- Lists information about a repo.

list -- Lists all available repos in the workspace.

update -- Updates information about a repo.

You can get this information by running

databricks repos --help

Please refer to https://docs.databricks.com/dev-tools/cli/repos-cli.html#repos-cli

RantoB
Valued Contributor

Thanks for your answer.

But then, how can I export a sub-directory which is within a repos in dbc format with cli ?

Prabakar
Esteemed Contributor III
Esteemed Contributor III

I haven't tried it, but I believe the below might work. Please try it out and let us know.

As per the doc, https://docs.databricks.com/dev-tools/cli/workspace-cli.html#export-a-directory-from-a-workspace-to-...

You can export a directory using the below command.

databricks workspace export_dir --overwrite /Users/someone@example.com/my-folder /Users/me/Downloads/my-folder

You can use the same command and try to export the repos directory. The only change will be on the path.

databricks workspace export_dir --overwrite /Repos/someone@example.com/my-folder /Users/me/Downloads/my-folder

RantoB
Valued Contributor

I already checked that.

First I don't know why my workspace is temporarily unavailable since always !

Second, I want actually to export from the repos and not from the workspace.

-werners-
Esteemed Contributor III

why dont you export from your git provider since you use repos?

In git you actually already have an export (assuming you have commited/pushed your code).

RantoB
Valued Contributor

I would like to export in DBC format and I connot do so from my git provider.

Prabakar
Esteemed Contributor III
Esteemed Contributor III

@Bertrand BURCKER​  Is your requirement to do it only from the CLI? Or to export the repos?

If it is to export the repos, you can export it as DBC format from the UI.

image

RantoB
Valued Contributor

I would like to export in DBC format with CLI.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.