<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Backing up your unity catalog metadata in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/backing-up-your-unity-catalog-metadata/m-p/169436#M2998</link>
    <description>&lt;P&gt;Nice writeup - the "recovery hasn't performed to reasonable expectations" gap you mention is worth digging into a bit, because I think it's a fundamental issue with backing up information_schema rows rather than DDL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;information_schema is a live view of current state, not a set of replayable statements. When you write those rows to Delta and later try to "restore" from them, you end up having to reverse-engineer CREATE TABLE / GRANT / COMMENT statements from tabular metadata, which is slow and fragile - that's almost certainly what's fighting you on performance. The fix that's worked for me is to capture the DDL text directly instead of (or alongside) the info_schema snapshot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- SHOW CREATE TABLE catalog.schema.table for table definitions (gives you a replayable CREATE statement, not just column metadata).&lt;/P&gt;&lt;P&gt;- SHOW GRANTS ON TABLE/SCHEMA/CATALOG ... for permissions, since grants aren't fully captured by the older information_schema views on every workspace - system.information_schema.grants or system.access.* (System Tables) is a more complete source if it's enabled on your account.&lt;/P&gt;&lt;P&gt;- Store these as plain text per-object rather than as a dataframe of metadata rows. Restore then becomes "replay the DDL," which is orders of magnitude faster than trying to reconstruct statements from rows at recovery time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the parallelization side: spark.catalog.listTables() and looping table-by-table is inherently serial. Since each backup is just a metadata query plus a small write, you can fan it out with a ThreadPoolExecutor (Python threads are fine here since the work is I/O-bound - waiting on the metastore and object storage, not CPU) instead of dbutils.notebook.run per catalog, which has heavier per-call overhead. That's the difference between backing up "system" (every catalog) taking hours vs. minutes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also worth noting for anyone using this as a real DR plan: this captures Unity Catalog's own metadata, but doesn't capture Volumes' underlying file listings or external location/storage credential definitions, which live outside information_schema entirely and need their own &lt;STRONG&gt;SHOW-based&lt;/STRONG&gt; capture.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2026 13:17:20 GMT</pubDate>
    <dc:creator>DoTA</dc:creator>
    <dc:date>2026-09-22T13:17:20Z</dc:date>
    <item>
      <title>Backing up your unity catalog metadata</title>
      <link>https://community.databricks.com/t5/data-governance/backing-up-your-unity-catalog-metadata/m-p/118544#M2476</link>
      <description>&lt;P&gt;Unity Catalog (UC) tracks the metadata and your cloud storage accounts store the your data. This python script will extract the metadata from {catalog}.information_schema into folders in a storage location. Take this and put into a notebook.&amp;nbsp; Make data backups from the cloud storage console. {catalog} can also include system, which will cover every catalog in UC. The UC configuration is recoverable from the information_schema metadata however I've not had time to make the recovery run in parallel and perform to reasonable expectations.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;%python&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;storage_location = dbutils.widgets.get("storageLocation")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;catalog_name = dbutils.widgets.get("catalogName")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;(storage_location, catalog_name)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;%python&lt;/FONT&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;#&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;# For every table in information schema, make a backup copy of it to the storage location and all of the other metadata&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;#&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;table_list = spark.catalog.listTables(f"`{catalog_name}`.information_schema")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="andale mono,times"&gt;for table in table_list:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="andale mono,times"&gt;print(f'backing up {table.catalog}.information_schema.{table.name} to {storage_location}/{table.name}...')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="andale mono,times"&gt; info_schema_table_df = spark.sql(f"SELECT * FROM {table.catalog}.information_schema.{table.name}")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="andale mono,times"&gt; info_schema_table_df.write.format("delta").mode("overwrite").save(f"{storage_location}/{table.name}")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="andale mono,times"&gt;print('backup complete')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 May 2025 15:13:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/backing-up-your-unity-catalog-metadata/m-p/118544#M2476</guid>
      <dc:creator>DouglasMoore</dc:creator>
      <dc:date>2025-05-08T15:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Backing up your unity catalog metadata</title>
      <link>https://community.databricks.com/t5/data-governance/backing-up-your-unity-catalog-metadata/m-p/169436#M2998</link>
      <description>&lt;P&gt;Nice writeup - the "recovery hasn't performed to reasonable expectations" gap you mention is worth digging into a bit, because I think it's a fundamental issue with backing up information_schema rows rather than DDL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;information_schema is a live view of current state, not a set of replayable statements. When you write those rows to Delta and later try to "restore" from them, you end up having to reverse-engineer CREATE TABLE / GRANT / COMMENT statements from tabular metadata, which is slow and fragile - that's almost certainly what's fighting you on performance. The fix that's worked for me is to capture the DDL text directly instead of (or alongside) the info_schema snapshot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- SHOW CREATE TABLE catalog.schema.table for table definitions (gives you a replayable CREATE statement, not just column metadata).&lt;/P&gt;&lt;P&gt;- SHOW GRANTS ON TABLE/SCHEMA/CATALOG ... for permissions, since grants aren't fully captured by the older information_schema views on every workspace - system.information_schema.grants or system.access.* (System Tables) is a more complete source if it's enabled on your account.&lt;/P&gt;&lt;P&gt;- Store these as plain text per-object rather than as a dataframe of metadata rows. Restore then becomes "replay the DDL," which is orders of magnitude faster than trying to reconstruct statements from rows at recovery time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the parallelization side: spark.catalog.listTables() and looping table-by-table is inherently serial. Since each backup is just a metadata query plus a small write, you can fan it out with a ThreadPoolExecutor (Python threads are fine here since the work is I/O-bound - waiting on the metastore and object storage, not CPU) instead of dbutils.notebook.run per catalog, which has heavier per-call overhead. That's the difference between backing up "system" (every catalog) taking hours vs. minutes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also worth noting for anyone using this as a real DR plan: this captures Unity Catalog's own metadata, but doesn't capture Volumes' underlying file listings or external location/storage credential definitions, which live outside information_schema entirely and need their own &lt;STRONG&gt;SHOW-based&lt;/STRONG&gt; capture.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2026 13:17:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/backing-up-your-unity-catalog-metadata/m-p/169436#M2998</guid>
      <dc:creator>DoTA</dc:creator>
      <dc:date>2026-09-22T13:17:20Z</dc:date>
    </item>
  </channel>
</rss>

