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?

6 REPLIES 6

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