cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

@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

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

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

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group