Migration of Databricks Jobs, SQL dasboards and Alerts from lower environment to higher environment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023
10:33 PM
- last edited
2 weeks ago
by
Advika
I want to move Databricks Jobs, SQL dasboards, Queries and Alerts from lower environment to higher environment, how we can move?
- Labels:
-
SQL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 07:32 PM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 07:48 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 09:37 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 12:49 AM
@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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 12:51 AM
@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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 12:32 AM
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!

