Migrate from Databricks to Apache Spark

Moving from Databricks to self-hosted Apache Spark keeps your Delta tables in your own storage, so the work is mostly orchestration, catalog, notebooks and Databricks-only code. This page maps what moves, what breaks and how to sequence the cutover.

On this page

Migrate from Databricks to Apache Spark: what the move involves

If your Databricks renewal, DBU bill or exit concern is pushing you toward self-hosted Spark, the good news is that table data can usually stay where it is while the platform layer is rebuilt. Classic Databricks workspaces store Delta Lake tables as Parquet files plus a transaction log in a bucket in your own cloud account, so the data already sits under your control. The work is in the layers around those files: jobs, catalog, notebooks, access control and any Databricks-only APIs your code calls. Platform engineering, data engineering and security teams usually share this work, with platform engineering owning the cluster and orchestration, data engineering porting pipelines, and security reviewing catalog permissions and credentials.

Expect the effort to concentrate in four places. First, Databricks Jobs must move to an orchestrator such as Apache Airflow, which means rewriting schedules, retries, dependencies and alerts. Second, Unity Catalog governs tables and grants inside Databricks, so you must choose a replacement, such as Unity Catalog OSS or another catalog, and re-create its permissions and lineage. Third, notebooks export as source files, Jupyter .ipynb or R Markdown, but their widgets, secrets helpers and dbutils calls need manual replacement. Fourth, any code using Databricks-only APIs needs a standard Spark equivalent or a documented exception. Spark itself has no notebook workspace, job scheduler UI or catalog, so each of these must be assembled from separate tools, and a pilot that reruns a few representative pipelines against the same Delta paths is the fastest way to find the gaps.

On risk, the main exposure is operational rather than data loss, provided you do not move or rewrite table files during the switch. Confirm with your Databricks account team exactly which storage your workspace uses, whether it is a classic workspace with a customer bucket or a serverless setup with default storage, and export any notebooks and job definitions before the contract ends. Check the Spark release line you plan to run: the Spark versioning policy describes a 3.5.x extended LTS ending in November 2027 with security fixes only, so pick a version you can maintain. Plan for a period in which both platforms run in parallel, and ask any implementation partner to write the scope, cutover steps and rollback plan in advance.

Which Databricks capabilities map to self-hosted Spark and what needs rework

This table maps each Databricks capability to its self-hosted Spark equivalent and marks it as clean, needs rework or gap. Delta tables in your own bucket usually move with little change, while notebooks, Jobs, Unity Catalog and Databricks-only APIs need planned work. Confirm each behavior against the Spark and Delta Lake versions you plan to run, since Spark 4.x requires Scala 2.13.

Databricks capabilitySelf-hosted equivalentStatus and what to confirm
Delta tables in your cloud bucketDelta Lake read and write with Spark, same Parquet files and transaction logClean. Confirm the Delta Lake version matches the Spark line you run and test reads after any protocol upgrade.
NotebooksJupyterHub or another notebook server, with exported .ipynb filesNeeds rework. Exported notebooks keep code but lose workspace paths, widgets and Databricks display helpers.
Databricks Jobs and workflowsApache Airflow or another orchestrator submitting spark-submit or operator-managed jobsNeeds rework. Task dependencies, retries and alerts must be rebuilt and tested per job.
Unity Catalog tables and permissionsUnity Catalog OSS or another catalog, with grants reapplied in Spark and the object storeGap in place. Confirm which privileges, lineage and row filters the chosen catalog supports before cutover.
Spark SQL and DataFrame codeApache Spark with Python, SQL, Scala, Java or RClean for most code. Check Spark version differences, Scala 2.12 libraries (dropped in Spark 4) and Databricks runtime-only functions.
Cluster compute and autoscalingSpark standalone, YARN or Kubernetes with the Spark Kubernetes OperatorNeeds rework. Node pools, autoscaling and job sizing must be designed and monitored by your team.
Auto Loader and structured streamingStructured Streaming with file sources and checkpoints in your storageNeeds rework. Auto Loader's file discovery has no direct drop-in, so confirm checkpoint and notification behavior in your setup.
Databricks-specific APIs and utilities (dbutils, Photon, serverless)Standard Spark APIs and libraries, Spark Connect for remote clientsGap. Remove dbutils calls and Photon-dependent assumptions, and test performance without them.

What data and integrations move, and which export paths to use

Most of the data question is about storage, not export. Delta tables on classic workspaces already sit as Parquet files and a transaction log in your own bucket, while notebooks, jobs, secrets and permissions must be exported, recreated or rebuilt. The cards below separate what moves as files from what moves as code and configuration.

Delta tables in your bucket

On classic workspaces, Delta table data and metadata are stored as Parquet files plus a transaction log in a bucket you provide, so the table files already sit in your cloud account. Confirm the storage model for serverless compute and for any managed storage location before assuming the same is true there. Check which bucket, prefix and IAM or bucket policy each table uses, then point Spark at the same paths on your own cluster.

Delta Lake docs

Notebooks as source or Jupyter files

Databricks exports notebooks as source files, Jupyter .ipynb or R Markdown. Source format suits version control and code review, while .ipynb keeps cell outputs and fits JupyterHub. Export folders as ZIP or DBC archives, then inspect the output for Databricks-specific magic commands, dbutils calls and widget definitions that need rewriting before the notebook runs on plain Spark.

Export and import docs

Job definitions to rebuild

Databricks Jobs hold schedules, task dependencies, cluster settings, retries and alert rules in workspace configuration that does not transfer as a file. Inventory every job, record its trigger, inputs, outputs and owner, then rebuild each one as a DAG in your orchestrator. Test each rebuilt job against the same input data and compare row counts and output checksums before retiring the original.

Secrets, permissions and connections

Secret scopes, service principals, personal access tokens and external connections such as JDBC sources or cloud credentials do not move with notebooks or tables. Recreate them in your secrets manager and identity provider, and map each Unity Catalog grant to the equivalent catalog or storage policy. Record who owned each credential so that rotation and access reviews continue after the cutover.

Delta Trino, Flink and UniForm options

Delta Lake's README lists a Trino connector that reads and writes Delta tables and a preview Apache Flink connector that writes to Delta Lake, which lets other engines reach the same tables during a transition. UniForm lets Iceberg and Hudi clients read Delta tables. Confirm the supported operations, versions and limits for each connector against its documentation before you rely on it for production reads or writes.

Delta Lake repository

Dependencies and cluster configuration

Libraries installed on Databricks clusters, init scripts, Spark configuration keys and Databricks Runtime versions all shape how jobs behave. Capture each cluster policy and library list in a requirements or lock file, and pin the Spark version you choose. Spark 4 is pre-built with Scala 2.13 and has dropped Scala 2.12 support, so check any Scala libraries against that line before you upgrade.

Migration sequence: inventory, pilot, parallel run, cutover and decommission

This sequence moves Databricks workloads to self-hosted Spark one dependency at a time, keeping Delta tables in place so each stage produces evidence that the next stage depends on. Each step ends with a named artifact that the migration owner can review before work continues.

  1. Inventory tables, notebooks, jobs and API calls

    Start by listing every Delta table, notebook, scheduled job, cluster policy, library, secret scope and external API call that the workspace uses. Record each table's storage location, format and owner, and note which notebooks use Databricks-only features such as dbutils, Databricks widgets or Databricks-specific SQL functions. The engineering lead and data owners should own this work, and it is done when the team has a dependency register that maps each job to the tables it reads and writes and the identities it runs under. Confirm with your own workspace audit logs and the Databricks documentation for your cloud, since the exact export options depend on your setup.

  2. Export notebooks and code to source files

    Export notebooks from the workspace as source files, Jupyter .ipynb or R Markdown, and export folders as ZIP or DBC archives, following the export options in the Databricks documentation. Store the exports in your version control system so that every notebook has a history outside the workspace. The output is a repository where each notebook maps to a file, with a short list of files that still call Databricks-only APIs flagged for rewriting in a later step.

  3. Run a pilot job against the same Delta tables

    Choose one low-risk batch job that reads and writes Delta tables already stored in your own cloud bucket. Stand up a self-hosted Spark cluster on Kubernetes or YARN, configure it with the Delta Lake library, and point the job at the same table paths. Spark does not ship with a catalog, so the pilot should use the table path directly until a catalog is chosen. The pilot is complete when the job runs to the end on self-hosted Spark, writes a new table version, and the Delta transaction log shows the commit. Record the Spark, Delta Lake and Scala versions you used, taken from the release pages of each project.

  4. Reconcile outputs in a parallel run

    Run the same jobs on Databricks and on self-hosted Spark for a fixed set of input windows and compare the results. Check row counts, schema, null counts, key uniqueness and aggregate totals for each output table, and compare job runtimes and failure behavior. Use Delta time travel where needed to compare the same input version on both sides. The output is a reconciliation report signed off by the data owner for each table, listing any differences and whether they are explained by timezone, floating-point or ordering behavior. Do not cut over a job that has unexplained differences.

  5. Replace Databricks Jobs with an orchestrator

    Recreate each scheduled job in a self-hosted orchestrator such as Apache Airflow, moving task dependencies, retry settings, schedules and alerting from the Databricks Jobs definitions into the new orchestrator's code. Keep credentials in your secrets manager rather than in job parameters. The output is a set of orchestrator definitions reviewed in version control, with a test run for each job showing that the scheduled outcome matches the reconciled output from the parallel run.

  6. Replace the catalog and access controls

    Decide which catalog will replace Unity Catalog, either Unity Catalog OSS or another self-hosted catalog, and confirm which features it supports for your table formats and access model. Register the migrated tables, then reapply permissions through the new catalog and the object store policies. Test that each group sees only the tables it saw in Databricks. The output is an access matrix comparing the old and new permissions, with each difference approved by the data owner. Confirm the current feature support of any catalog with its maintainers before you rely on it.

  7. Cut over workloads one group at a time

    Move workloads in groups, starting with the least critical, and keep the Databricks version of each job available for rollback until its group is stable. Track each cutover in a checklist that records the job owner, the date, the reconciliation report it depends on, the orchestrator run and any incidents. The output is a signed cutover checklist for each group, approved by the data owner and the platform owner, before the next group moves.

  8. Decommission the workspace and catalog

    After every group has run stably on self-hosted Spark for the period your team agrees, disable scheduled jobs in Databricks, export the final workspace archives, revoke service principals and cluster access, and remove the Unity Catalog metastore assignments only once no job or dashboard still points to them. Keep the exported notebooks and the reconciliation reports in your records. The output is a decommission record confirming that no workload depends on the Databricks control plane, together with the contract end steps your procurement team must confirm with Databricks.

How to run Databricks and self-hosted Spark side by side

During a migration, both platforms can point at the same Delta tables in object storage, so you can compare results without copying data first. Classic Databricks workspaces already write Delta Lake table files, Parquet data plus a transaction log, to a bucket in your own cloud account, so a self-hosted Spark cluster with read access to that bucket can run the same queries against the same files. Start by listing which tables each engine will read, which will be written by Databricks only, and which will be written by Spark. Keep that list in the migration runbook, because it is the document reviewers will ask for when they check who changed which data.

The rule that matters most is write ownership. Two engines should never write the same Delta table without a coordination mechanism you have tested. Assign each table a single writer for the parallel run, and give the other engine read-only credentials on the bucket prefix. Confirm in your own environment how concurrent writers behave, including whether your Delta Lake version and the Spark release you deploy handle optimistic concurrency conflicts as you expect, and what happens when a job from one platform fails mid-commit. Confirm also that the Databricks service principal and the Spark service account cannot both hold write permissions on the same prefix unless that overlap is intentional.

For reconciliation, use Delta Lake's transaction log and time travel. Each commit is recorded as a numbered table version, so you can query an earlier version from Spark and compare it with the same version read from Databricks, which makes differences in row counts or aggregates traceable to a specific commit. Record the table versions used for each comparison so results can be reproduced later. Time travel depends on retention settings, so check how long old files and log entries are kept in your environment before you rely on it for a sign-off window. The Delta Lake website lists the feature set and the engines that read the format.

How the migration differs for batch-heavy, streaming and SQL-led teams

Teams running scheduled batch pipelines usually have the most to move out of Databricks Jobs. The Delta tables stay where they are in your bucket, so the main work is re-creating job definitions, dependencies, retries, alerts and parameters in an orchestrator. Spark itself runs the same transformations, but you now own the cluster lifecycle that Databricks previously handled.

  • Orchestration: Map each Databricks job, task dependency and schedule to a self-hosted orchestrator such as Apache Airflow, and decide how retries and backfills will work.
  • Cluster management: Choose between standalone, YARN or Kubernetes for Spark, and plan how ephemeral clusters are started and torn down for each run.
  • Job parameters and secrets: Move parameters and credentials out of job settings into your secrets store and orchestrator variables.
  • Notebook-based jobs: Export notebooks as source or Jupyter files and convert widgets and dbutils calls into plain parameters that a scheduler can pass in.
  • Idempotency: Confirm that each batch step can be rerun safely after a failure, since Databricks job repair behavior will not be available in the same form.

Check the job inventory first, including which jobs depend on Databricks-specific libraries or dbutils, and confirm the orchestrator's support for your scheduling and alerting needs before cutover.",

What drives the cost and duration of the move

This table lists the factors that set the effort and running cost of leaving Databricks for self-hosted Spark, with the one-time and recurring costs each one creates. Read each row as a question to answer during scoping, because the same workload can cost very different amounts depending on how many notebooks, Databricks-only APIs and permission rules it depends on. The main takeaway is that the Databricks platform fee is only one line of the bill, and the engineering, orchestration and on-call work you take on usually dominates the first year.

DriverWhy it changes cost or effortWhat to confirm or keep down
Notebooks and jobsEach notebook, widget and scheduled job must be exported, rewritten or re-scheduled. Counts across the estate set the migration backlog.Inventory notebooks and jobs by owner and run frequency. Retire unused ones before the move.
Databricks-only API usageCalls to dbutils, Databricks Jobs APIs, Photon-specific behavior or proprietary Delta features need replacements in plain Spark code.Scan code for dbutils and Databricks SDK imports. Ask the vendor or partner to list each dependency in the quote.
Unity Catalog permissionsGrants, row filters, column masks and lineage tie into Unity Catalog. Moving them to Unity Catalog OSS or another catalog means redefining each rule.Export current grants and count distinct principals. Confirm which policies must be reproduced exactly.
Streaming stateStructured Streaming checkpoints and offsets must stay consistent with the new cluster. Moving a running stream usually needs a planned restart point.List active streams, their sources and checkpoint locations. Plan downtime and replay windows in writing.
Scala and Python versionsSpark 4 is built with Scala 2.13 and drops Scala 2.12. Libraries and UDFs pinned to older runtimes need rebuilds or upgrades.Check every library and jar against the target Spark and Scala versions before scoping.
Orchestrator choiceReplacing Databricks Jobs with a tool such as Apache Airflow adds DAG authoring, retries, alerting and secrets handling for each job.Choose the orchestrator first, then estimate rewrite effort per job type.
Kubernetes or YARN platform workSpark runs on standalone, YARN or Kubernetes. Kubernetes needs cluster, storage, autoscaling and the Spark Kubernetes Operator, while YARN needs Hadoop operations skills.Confirm which cluster manager your platform team already runs and who patches it.
Recurring costs (compute, people, on-call)Object storage and cloud compute continue at similar scale. Engineers maintain the platform, upgrades and 24/7 support.Ask a quote to split one-time migration work from monthly run costs, with named on-call coverage.

What usually goes wrong and how to prevent it

Most failed Databricks exits do not fail on the first job run. They fail later, when a hidden API dependency, a permission gap, a duplicate write path or an unowned cluster surfaces in production. The six cards below cover the risks we see most often when moving notebooks, Delta tables and jobs to self-hosted Spark, each with a check to run before cutover.

Unmapped Databricks-only APIs

Notebooks and jobs often call dbutils, Databricks-specific Spark configuration keys, Photon-dependent behavior or REST endpoints that have no equivalent on open-source Spark. These calls fail at runtime, sometimes only on a rarely executed branch. Build an inventory by searching exported notebooks and job definitions for dbutils., spark.databricks. and databricks imports, then assign each hit a replacement or a removal decision before the first test run.

Export notebooks docs

Catalog permissions lost in translation

Unity Catalog grants table, schema and volume privileges that do not carry over automatically when you move to Unity Catalog OSS, another catalog or direct storage paths. A team can end up with broader access than before, or with jobs that silently fail for users who lost a grant. Export the current grant list, map each principal to a role in the new catalog, and test access with a non-admin account for every table group before retiring the old permissions.

Dual writes to the same table

During cutover, a Databricks job and a self-hosted Spark job can both write to the same Delta table location. Two writers without a shared commit path can produce conflicting transaction log entries, duplicate rows or partial merges. Assign one writer per table and record the switchover date in the runbook. Keep the Databricks job paused rather than disabled, and confirm with a row count and a Delta history check that only the new writer commits after the switch.

Spark version drift

Databricks runtimes and self-hosted Spark distributions can run different Spark and Delta Lake versions, so behavior around SQL semantics, Delta protocol features and library dependencies may shift. Spark 4.2.0 was released on July 14, 2026, while the 3.5.x extended LTS ends in November 2027 with security fixes only. Pin one Spark and one Delta Lake version for the migration, record the choice, and plan a separate upgrade window with its own regression tests.

Spark versioning policy

Scala 2.12 code breaking on Spark 4

Spark 4 is pre-built with Scala 2.13 and has dropped Scala 2.12 support. Libraries, UDFs and compiled JARs built against 2.12 will fail to load or link, often with errors that look unrelated to the migration. Scan build files and artifact names for _2.12 suffixes, rebuild dependencies for Scala 2.13, and run every UDF in a test job before scheduling it. If rebuilding is not possible, keep those workloads on a 3.5.x line until they are replaced.

Spark downloads page

Notebook widgets and dbutils dependencies

Widgets, dbutils.notebook.run chains and dbutils.secrets calls hold business logic that does not survive a plain export to .ipynb or source files. A notebook that reads a widget value or a secret scope will fail, or run with defaults that produce wrong output. Replace widgets with explicit parameters passed by the orchestrator, move secret reads to your secrets manager, and replace notebook-to-notebook calls with functions in a shared package that you can unit test.

Underestimated on-call ownership

On Databricks, the platform team handles cluster start failures, runtime upgrades, job retries and workspace permissions. After the move, your team owns the Spark cluster manager, the orchestrator, the catalog, the notebook server and the storage access policies. Name an owner for each component before cutover, write the escalation path and alert rules, and agree who is paged for failed scheduled jobs and for failed Delta commits. Treat this as an ongoing staffing decision, not a one-time setup task.

Questions teams ask before moving from Databricks to Spark

How much effort does moving from Databricks to Spark take?

The effort depends mostly on how much of your Databricks footprint is Databricks-specific rather than standard Spark and Delta Lake. Teams whose tables already sit in their own bucket and whose code is mostly PySpark or SQL have less to move than teams with heavy use of Databricks Jobs, Unity Catalog permissions, Databricks-only APIs and workspace-bound notebooks. Ask for an inventory of jobs, notebooks, libraries, catalog objects and access rules before anyone estimates the work.

What drives the time a Databricks to Spark move takes?

Four factors set the pace: how many pipelines must be re-platformed, how many catalog objects and permission rules must be recreated, how often pipelines feed dashboards or downstream systems, and how much parallel running the business requires before cutover. Other drivers include the Spark version you target, since Spark 4 is built with Scala 2.13 and dropped Scala 2.12, and whether your team has already run an orchestrator and a catalog in production. Ask any provider to tie its timeline to a written inventory and a named cutover plan.

Can our own engineers do this move without outside help?

Often yes, if the team already runs Spark, an orchestrator and object storage, and has someone who owns identity and access control. Spark does not include a notebook workspace, job scheduler UI, catalog or access control layer, so your team must choose and operate those pieces. Outside help is most useful for platform design, hardening, migrating permissions and testing cutover. DeployOpen plans and implements these self-hosted platforms in your own infrastructure under a written, fixed scope.

Do our Delta tables have to be copied to a new location?

Usually no. Databricks stores Delta Lake table data and metadata in cloud object storage as Parquet files plus a transaction log, and classic workspaces use a customer-provided S3 bucket, so table files on classic compute already sit in your cloud account. Spark can read and write the same Delta tables with Delta Lake, and Trino has a Delta Lake connector. Confirm with your platform team whether any tables use serverless default storage or managed locations, since those need a separate check before you decide what to move.

What replaces Unity Catalog and Databricks Jobs?

Unity Catalog is usually replaced by a catalog layer chosen for your stack, such as Unity Catalog OSS or another open catalog, combined with your own access control in the engines that read the data. Databricks Jobs is usually replaced by an orchestrator such as Apache Airflow, which schedules Spark applications, handles retries and records run history. Spark runs on Kubernetes or YARN, and the Apache Spark Kubernetes Operator, an Apache-2.0 subproject, can manage Spark applications on Kubernetes through the operator pattern. Permissions and lineage must be rebuilt, not copied, so plan that work explicitly.

What does the work need from our staff?

The work needs input from data engineers who know the pipelines, platform engineers who run Kubernetes or YARN and object storage, security staff who define access rules and logging, and an owner for each business dataset who confirms results. Expect to supply access to the Databricks workspace for export, a place to store notebook exports as source files, Jupyter .ipynb files or R Markdown, and time for testing and sign-off. Clear decisions on the notebook and job inventory early in the project reduce rework later.

What recurring costs remain after we move to self-hosted Spark?

The Databricks DBU charge goes away, but your cloud compute and storage bills continue, since Databricks charges DBUs on top of cloud costs that the customer's provider bills anyway. New recurring costs include the staff time to operate the cluster, orchestrator, catalog, notebooks and upgrades, plus support and on-call coverage. Spark 3.5.x has an extended LTS that ends in November 2027 with security fixes only, so budget for periodic version upgrades. Ask any quote to separate one-time build work from these ongoing operating costs.

How self-hosted Spark, Delta tables and the catalog fit together

The diagram starts with analysts and jobs submitting work through Spark clients or Spark Connect to a cluster manager, which can be Kubernetes, YARN or Spark's standalone manager. The orchestrator triggers those jobs, and the catalog tells Spark where each table lives. Delta tables stay as Parquet files and a transaction log in the client's own object storage, inside the trust boundary. Check that the catalog, the orchestrator and the compute nodes all reach the same bucket with scoped credentials, because Spark ships with none of these pieces.

Spark clients, cluster manager, catalog and Delta files inside the client's cloud account.

How DeployOpen scopes and runs a Databricks to Spark migration

DeployOpen plans and implements self-hosted Apache Spark, Delta Lake and the orchestration and catalog pieces around them inside your own cloud account or data center. Work starts with a written scope that covers which notebooks, jobs and Unity Catalog permissions move, and which stay on Databricks until cutover is complete.

How we scope

  • Inventory notebooks, jobs, libraries and Databricks-only API calls that the migration must replace or remove.
  • Confirm which Delta tables stay in your existing bucket and which need access reconfigured for Spark.
  • Agree in writing the catalog choice, orchestrator, Spark version line and the list of deliverables before work starts.

How we build

  • Stand up Spark on your chosen cluster manager with the Delta Lake configuration, storage credentials and networking your security team approves.
  • Port notebooks to exported source or Jupyter files and rebuild scheduled jobs in the agreed orchestrator with retries and alerts.
  • Test table reads, writes, merges and job outputs against Databricks results, and document any differences found.

How we hand over

  • Deliver runbooks for deployment, upgrades, backup of the catalog and access control changes, written for your platform team.
  • Provide evidence of configuration, access control and audit logging so your compliance and security teams can review the setup.
  • Run a cutover plan with a parallel run period and a documented rollback path before Databricks workloads are retired.

How we support

  • Ongoing support, Spark and Delta Lake upgrades and continuous testing are available as a retainer.
  • Retainer scope and response expectations are set in writing, so ask for them as part of the quote.
  • Confirm with DeployOpen which Spark release line and maintenance window your team expects before the scope is signed.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.