cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Migration of Databricks Jobs, SQL dasboards and Alerts from lower environment to higher environment?

DataArchitect
New Contributor III

I want to move Databricks Jobs, SQL dasboards, Queries and Alerts from lower environment to higher environment, how we can move?

7 REPLIES 7

Kaniz_Fatma
Community Manager
Community Manager

no, it is just for sql queries, whats about notebooks, jobs with multiple tasks, dasboards.. moreover there it is just mentioned with help of rest api, but how we can do, is there any sample file?

Anonymous
Not applicable

@Shubham Agagwralโ€‹ :

Migrating Notebooks:

  • Notebooks can be exported as DBC files, which contain the notebook code, visualizations, and metadata. You can download DBC files from the lower environment.
  • In the higher environment, you can import DBC files by uploading them using the Databricks UI or programmatically using the Databricks Workspace API. The API endpoint for importing notebooks is /api/2.0/workspace/import
  • Link : https://docs.databricks.com/notebooks/notebooks-manage.html#export-and-import-notebooks

Migrating Jobs with Multiple Tasks:

  • For jobs with multiple tasks, you can export the job configuration in JSON format. The job configuration includes information about the job's tasks, clusters, libraries, and scheduling details.
  • Use the Databricks CLI (databricks jobs export command) or the REST API ( /api/2.0/jobs/export endpoint) to export the job configuration in JSON format from the lower environment.
  • In the higher environment, import the job configuration using the Databricks CLI (databricks jobs import command) or the REST API ( /api/2.0/jobs/import endpoint). The imported job will include all its associated tasks.
  • Link: https://docs.databricks.com/api/workspace/jobs#import

Migrating Dashboards:

  • Dashboards in Databricks can be exported as JSON files. The JSON file contains the dashboard layout, visualizations, and associated queries.
  • Export the dashboard JSON file from the lower environment using the Databricks UI or the REST API (/api/2.0/sql/dashboards/export endpoint).
  • Import the dashboard JSON file in the higher environment using the Databricks UI or the REST API ( /api/2.0/sql/dashboards/import endpoint). This will recreate the dashboard with its layout, visualizations, and queries.

Thanks for such detailed information, please find the following doubts:

1) Migrating notebooks: That is fine..

2) Migrating Jobs with Multiple Tasks: That documentation is fine, but whats the exact command to post or get it the jobs... its just mentioned Get/Post /api/2.1/jobs/create/update , whats the exact syntax, how it will authenticate the databricks another system, for instance I am running in local and i want to migrate it from lower environment to higher env. what would be the query(any sample example) which will help to relate it...

3) Migrating Dashboards: I am not able to see any export or import option, or else can you give some reference how to migrate it with rest api

Anonymous
Not applicable

@Shubham Agagwralโ€‹ 

I am providing some documentation related to this.

Migrating Databricks Jobs with Multiple Tasks:

  • Databricks REST API: JobsDocumentation: Jobs API - Databricks REST API
    • This documentation provides details about the Jobs API, including the endpoints for creating and updating jobs, authentication requirements, and request/response examples.

Anonymous
Not applicable

@Shubham Agagwralโ€‹ : For migrating dashboards have you used terraform to do so?

Please let me know -

https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs/resources/sql_query

Anonymous
Not applicable

Hi @Shubham Agagwralโ€‹ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

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