Use Greenmask when you want to import a representative slice of your production database into a Xata branch. For example to evaluate Xata against your real schema and workload without copying 100% of your data. Greenmask follows your foreign-key graph from a chosen “entrypoint” table and exports only the rows that hang off it (and their dependencies), preserving referential integrity.If you want a full copy of your database into Xata, use xata clone instead — see the provider-specific guides for AWS RDS, AWS Aurora, Azure, GCP Cloud SQL, Neon, Supabase, and self-hosted PostgreSQL. Greenmask is for the subset case.
A PostgreSQL source you can reach over the network (public endpoint or via your own VPN/SSH tunnel)
Xata account and project setup with a running main branch
Knowledge of your schema’s foreign-key structure — at minimum, which table you want as the subset “entrypoint” (typically users, tenants, accounts, or similar)
The exact format depends on your provider (see the other guides in this folder for AWS RDS, Neon, etc.). A generic PostgreSQL connection string looks like:
Go to a local folder that you want to save the Xata configuration to and initialize it like this:
xata init
Select your organization and project you want to use. For the database name you can either choose a new one (e.g xata) or use the same that you have in your source database. If the database doesn’t exist, it will be created.In case you need to redo this step, you can reset the configuration by deleting the .xata/project.json file and running xata init again.Once initialized, you can get the branch connection string Greenmask will restore into with:
xata branch url
Treat it as sensitive: it grants full write access.
pg_dump --schema=... (which Greenmask uses under the hood) doesn’t export PostgreSQL extension definitions from the public schema. Create any extensions your source schema uses on the target before the restore:
psql "$(xata branch url)" <<'SQL'CREATE EXTENSION IF NOT EXISTS pg_trgm;CREATE EXTENSION IF NOT EXISTS unaccent;-- add any others your source schema usesSQL
Create greenmask.yml in your working directory. Replace your_schema, your_entrypoint_table, and the predicate to match your schema. The example below assumes a multi-tenant SaaS shape where tenants.id is the subset root.
There’s no single “right” predicate. Start with a subset_conds value that returns a small slice (for example tenants.id <= 10), run the dump, and check the resulting row counts. Widen or narrow the condition and re-run until the subset is the size and shape you want — a tight predicate keeps the first few iterations fast while you dial it in.
-- List tables\dt your_schema.*-- Check counts on key tablesSELECT count(*) FROM your_schema.your_table;-- Sample some rowsSELECT * FROM your_schema.your_table LIMIT 10;
For a subset to be useful, every foreign-key reference in the target must point to a row that exists. To audit this, compare the foreign-key constraint count between source and target — they must match:
psql '<<source-connection-string>>' -At -c " SELECT count(*) FROM pg_constraint c JOIN pg_namespace n ON n.oid = c.connamespace WHERE c.contype='f' AND n.nspname='your_schema';"psql "$(xata branch url)" -At -c " SELECT count(*) FROM pg_constraint c JOIN pg_namespace n ON n.oid = c.connamespace WHERE c.contype='f' AND n.nspname='your_schema';"
Greenmask runs pg_dump/pg_restore under the hood, so the same version compatibility rules apply: your local pg_dump major version must be ≥ the source server’s, and the same major version as your Xata branch (currently PostgreSQL 18).
Sources with custom PostgreSQL extensions that Xata doesn’t support will fail during restore. Verify with psql -c "\dx" against your source first.
Greenmask’s subset model works best when your data has a clear “root” entity (a tenant, a user, an organization). Schemas without one will need more configuration work.
Greenmask supports rich PII transformations (anonymising emails, hashing names, redacting fields) on top of subsetting. Those are useful if you want to use your imported subset for dev/test as well as evaluation. See the Greenmask transformer docs for the full list.For full data migration (not subsets), see the other guides in this folder.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Xata","colors":{"primary":"#735adc","light":"#735adc","dark":"#735adc"},"logo":{"light":"https://mintcdn.com/xata/rYmGPszzEBdWMgvX/logo/light.svg?fit=max\u0026auto=format\u0026n=rYmGPszzEBdWMgvX\u0026q=85\u0026s=4ef098482078f4153c39dc17dd26476b","dark":"https://mintcdn.com/xata/rYmGPszzEBdWMgvX/logo/dark.svg?fit=max\u0026auto=format\u0026n=rYmGPszzEBdWMgvX\u0026q=85\u0026s=906164890c462dfd9eb1d334f76aa98d"},"favicon":"https://mintcdn.com/xata/rYmGPszzEBdWMgvX/favicon.svg?fit=max\u0026auto=format\u0026n=rYmGPszzEBdWMgvX\u0026q=85\u0026s=d86bc351b43f47f5187c041a7cb5539a","api":{},"background":{"decoration":"grid"},"navbar":{"links":[{"href":"https://xata.io/contact-support","label":"Support"},{"href":"https://www.xatastatus.com/","label":"Status"},{"href":"https://github.com/xataio","label":"GitHub"}],"primary":{"type":"button","label":"Xata Console","href":"https://console.xata.io/"}},"footer":{"socials":{"x":"https://twitter.com/xata","linkedin":"https://www.linkedin.com/company/xataio","github":"https://github.com/xataio","discord":"https://xata.io/discord","youtube":"https://www.youtube.com/@xataio"}},"fonts":{"family":"Geist"},"icons":{"library":"fontawesome"},"integrations":{"gtm":{"tagId":"GTM-PMD75RM"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"xata","hasAudioNarration":false,"actualSubdomain":"xata","customDomains":["xata.io"],"gitSource":{"type":"github","owner":"xataio","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adb657c57868d74937d85e9","collectionId":"25377e7c-e821-437f-9731-0d10fe376557","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adb657c57868d74937d85e9"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adf8aa9036ea32f556ed816","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"Guides","count":60},{"language":"default","tag":"API Reference","count":51},{"language":"default","tag":"Endpoints","count":51},{"language":"default","tag":"Open Source","count":34},{"language":"default","tag":"pgstream","count":34},{"language":"default","tag":"Organizations","count":22},{"language":"default","tag":"CLI Reference","count":19},{"language":"default","tag":"Manage","count":17},{"language":"default","tag":"Release Notes","count":15},{"language":"default","tag":"AI Agents","count":10}]},"assistantConfig":{"deflection":{"enabled":true,"email":"support@xata.io"}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"#navigation-items li[id=\"/overview\"]>button[aria-controls]>div:last-child{display:none}"}],"page":{"pagePath":"migrations/greenmask","slug":"/migrations/greenmask","pageMetadata":{"title":"Greenmask (subsets)","description":"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.","icon":"scissors","href":"/migrations/greenmask"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`when-to-use-this-guide`,children:`When to use this guide`}),`\n`,_jsxs(_components.p,{children:[`Use Greenmask when you want to import a `,_jsx(_components.strong,{children:`representative slice`}),` of your production database into a Xata branch. For example to evaluate Xata against your real schema and workload without copying 100% of your data. Greenmask follows your foreign-key graph from a chosen “entrypoint” table and exports only the rows that hang off it (and their dependencies), preserving referential integrity.`]}),`\n`,_jsxs(_components.p,{children:[`If you want a `,_jsx(_components.strong,{children:`full copy`}),` of your database into Xata, use `,_jsx(_components.code,{children:`xata clone`}),` instead — see the provider-specific guides for `,_jsx(_components.a,{href:`/migrations/aws-rds`,children:`AWS RDS`}),`, `,_jsx(_components.a,{href:`/migrations/aws-aurora`,children:`AWS Aurora`}),`, `,_jsx(_components.a,{href:`/migrations/azure`,children:`Azure`}),`, `,_jsx(_components.a,{href:`/migrations/gcp-cloudsql`,children:`GCP Cloud SQL`}),`, `,_jsx(_components.a,{href:`/migrations/neon`,children:`Neon`}),`, `,_jsx(_components.a,{href:`/migrations/supabase`,children:`Supabase`}),`, and `,_jsx(_components.a,{href:`/migrations/self-hosted`,children:`self-hosted PostgreSQL`}),`. Greenmask is for the subset case.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`A PostgreSQL source you can reach over the network (public endpoint or via your own VPN/SSH tunnel)`}),`\n`,_jsxs(_components.li,{children:[`Xata account and project setup with a running `,_jsx(_components.code,{children:`main`}),` branch`]}),`\n`,_jsxs(_components.li,{children:[`Knowledge of your schema’s foreign-key structure — at minimum, which table you want as the subset “entrypoint” (typically `,_jsx(_components.code,{children:`users`}),`, `,_jsx(_components.code,{children:`tenants`}),`, `,_jsx(_components.code,{children:`accounts`}),`, or similar)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`install-and-configure-the-xata-cli`,children:`Install and configure the Xata CLI`}),`\n`,_jsx(_components.p,{children:`Install the Xata CLI:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -fsSL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://xata.io/install.sh`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` bash`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Authenticate with your Xata account:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`install-greenmask`,children:`Install Greenmask`}),`\n`,_jsxs(_components.p,{children:[`Download a pre-built binary from the `,_jsx(_components.a,{href:`https://github.com/GreenmaskIO/greenmask/releases`,children:`Greenmask releases page`}),`. This guide is written against `,_jsx(_components.strong,{children:`v0.2.19`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -fsSL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://github.com/GreenmaskIO/greenmask/releases/download/v0.2.19/greenmask-linux-amd64.tar.gz`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` tar`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -xz`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./greenmask`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --version`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Replace `,_jsx(_components.code,{children:`linux-amd64`}),` with `,_jsx(_components.code,{children:`darwin-arm64`}),` etc. as needed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`find-your-source-connection-string`,children:`Find your source connection string`}),`\n`,_jsx(_components.p,{children:`The exact format depends on your provider (see the other guides in this folder for AWS RDS, Neon, etc.). A generic PostgreSQL connection string looks like:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`postgresql://your_username:your_password@your-host:5432/your_database?sslmode=require`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`initialize-xata-project`,children:`Initialize Xata project`}),`\n`,_jsx(_components.p,{children:`Go to a local folder that you want to save the Xata configuration to and initialize it like this:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Select your organization and project you want to use. For the database name you can either choose a new one (e.g `,_jsx(_components.code,{children:`xata`}),`) or use the same that you have in your source database. If the database doesn’t exist, it will be created.`]}),`\n`,_jsxs(_components.p,{children:[`In case you need to redo this step, you can reset the configuration by deleting the `,_jsx(_components.code,{children:`.xata/project.json`}),` file and running `,_jsx(_components.code,{children:`xata init`}),` again.`]}),`\n`,_jsx(_components.p,{children:`Once initialized, you can get the branch connection string Greenmask will restore into with:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` url`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Treat it as sensitive: it grants full write access.`}),`\n`,_jsx(Heading,{level:`2`,id:`prepare-the-target-branch`,children:`Prepare the target branch`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pg_dump --schema=...`}),` (which Greenmask uses under the hood) doesn’t export PostgreSQL extension definitions from the `,_jsx(_components.code,{children:`public`}),` schema. Create any extensions your source schema uses on the target `,_jsx(_components.em,{children:`before`}),` the restore:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch url)\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`'SQL'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`CREATE EXTENSION IF NOT EXISTS pg_trgm;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`CREATE EXTENSION IF NOT EXISTS unaccent;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`-- add any others your source schema uses`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SQL`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`To list the extensions your source uses:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003c\u003csource-connection-string>>'`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\\\\dx\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`write-your-subset-config`,children:`Write your subset config`}),`\n`,_jsxs(_components.p,{children:[`Create `,_jsx(_components.code,{children:`greenmask.yml`}),` in your working directory. Replace `,_jsx(_components.code,{children:`your_schema`}),`, `,_jsx(_components.code,{children:`your_entrypoint_table`}),`, and the predicate to match your schema. The example below assumes a multi-tenant SaaS shape where `,_jsx(_components.code,{children:`tenants.id`}),` is the subset root.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`33`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`33`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`common`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` pg_bin_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/usr/lib/postgresql/16/bin\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # or wherever your local pg_dump lives`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` tmp_dir`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/tmp\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` level`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"info\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"json\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`storage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"directory\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` directory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./dump\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`dump`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` pg_dump_options`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dbname`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003c\u003csource-connection-string>>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` schema`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your_schema\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` load-via-partition-root`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` transformation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`schema`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your_schema\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tenants\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` subset_conds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your_schema.tenants.id \u003c= 100\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`restore`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` pg_restore_options`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dbname`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003c\u003cxata-branch-connection-string>>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` exit-on-error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` no-owner`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` no-privileges`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`There’s no single “right” predicate. Start with a `,_jsx(_components.code,{children:`subset_conds`}),` value that returns a small slice (for example `,_jsx(_components.code,{children:`tenants.id \u003c= 10`}),`), run the dump, and check the resulting row counts. Widen or narrow the condition and re-run until the subset is the size and shape you want — a tight predicate keeps the first few iterations fast while you dial it in.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`run-the-dump`,children:`Run the dump`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./greenmask`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --config`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` greenmask.yml`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dump`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`restore-into-xata`,children:`Restore into Xata`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./greenmask`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --config`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` greenmask.yml`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` restore`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` latest`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If you want to retry, drop the schema on the target first:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch url)\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"DROP SCHEMA IF EXISTS your_schema CASCADE;\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`then re-create the extensions (see the “Prepare the target branch” step) and re-run `,_jsx(_components.code,{children:`restore`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`verify`,children:`Verify`}),`\n`,_jsx(_components.p,{children:`After restore, verify the import:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch url)\"`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- List tables`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\\\\dt your_schema.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Check counts on key tables`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` count`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` your_schema`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`your_table`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Sample some rows`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` your_schema`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`your_table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`foreign-key-integrity-check`,children:`Foreign-key integrity check`}),`\n`,_jsx(_components.p,{children:`For a subset to be useful, every foreign-key reference in the target must point to a row that exists. To audit this, compare the foreign-key constraint count between source and target — they must match:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003c\u003csource-connection-string>>'`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -At`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` SELECT count(*) FROM pg_constraint c`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` JOIN pg_namespace n ON n.oid = c.connamespace`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` WHERE c.contype='f' AND n.nspname='your_schema';\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`xata`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch url)\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -At`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` SELECT count(*) FROM pg_constraint c`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` JOIN pg_namespace n ON n.oid = c.connamespace`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` WHERE c.contype='f' AND n.nspname='your_schema';\"`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`limits`,children:`Limits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Greenmask runs `,_jsx(_components.code,{children:`pg_dump`}),`/`,_jsx(_components.code,{children:`pg_restore`}),` under the hood, so the same version compatibility rules apply: your local `,_jsx(_components.code,{children:`pg_dump`}),` major version must be ≥ the source server’s, and the same major version as your Xata branch (currently PostgreSQL 18).`]}),`\n`,_jsxs(_components.li,{children:[`Sources with custom PostgreSQL extensions that Xata doesn’t support will fail during restore. Verify with `,_jsx(_components.code,{children:`psql -c \"\\\\dx\"`}),` against your source first.`]}),`\n`,_jsx(_components.li,{children:`Greenmask’s subset model works best when your data has a clear “root” entity (a tenant, a user, an organization). Schemas without one will need more configuration work.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`going-further`,children:`Going further`}),`\n`,_jsxs(_components.p,{children:[`Greenmask supports rich PII transformations (anonymising emails, hashing names, redacting fields) on top of subsetting. Those are useful if you want to use your imported subset for dev/test as well as evaluation. See the `,_jsx(_components.a,{href:`https://docs.greenmask.io/latest/built_in_transformers/`,children:`Greenmask transformer docs`}),` for the full list.`]}),`\n`,_jsx(_components.p,{children:`For full data migration (not subsets), see the other guides in this folder.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Greenmask (subsets)","description":"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.","icon":"scissors","href":"/migrations/greenmask"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"When to use this guide","slug":"when-to-use-this-guide","depth":2,"children":[]},{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Install and configure the Xata CLI","slug":"install-and-configure-the-xata-cli","depth":2,"children":[]},{"title":"Install Greenmask","slug":"install-greenmask","depth":2,"children":[]},{"title":"Find your source connection string","slug":"find-your-source-connection-string","depth":2,"children":[]},{"title":"Initialize Xata project","slug":"initialize-xata-project","depth":2,"children":[]},{"title":"Prepare the target branch","slug":"prepare-the-target-branch","depth":2,"children":[]},{"title":"Write your subset config","slug":"write-your-subset-config","depth":2,"children":[]},{"title":"Run the dump","slug":"run-the-dump","depth":2,"children":[]},{"title":"Restore into Xata","slug":"restore-into-xata","depth":2,"children":[]},{"title":"Verify","slug":"verify","depth":2,"children":[{"title":"Foreign-key integrity check","slug":"foreign-key-integrity-check","depth":3,"children":[]},{"title":"Limits","slug":"limits","depth":3,"children":[]}]},{"title":"Going further","slug":"going-further","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/xata/42338cddc6e87248/tracking.js"],"subdomain":"xata","siteName":"Xata","title":"Greenmask (subsets) - Xata","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-02T14:40:55.015Z","originalFileLocation":"migrations/greenmask.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Xata\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Greenmask (subsets) - Xata\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Xata\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://xata.io/docs/migrations/greenmask\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://xata.mintlify.app/_mintlify/api/og/v2?division=Import+and+Migrate\u0026amp;title=Greenmask+%28subsets%29\u0026amp;description=Learn+how+to+import+a+referentially-consistent+subset+of+your+PostgreSQL+database+to+Xata+using+Greenmask.\u0026amp;theme=a98dfbe8d11c1328e16cdb2b\u0026amp;signature=a27edc5f2084d32244cb6df998d98f6cc32827f0bdf1196528987dfe3178db62\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Greenmask (subsets) - Xata\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://xata.mintlify.app/_mintlify/api/og/v2?division=Import+and+Migrate\u0026amp;title=Greenmask+%28subsets%29\u0026amp;description=Learn+how+to+import+a+referentially-consistent+subset+of+your+PostgreSQL+database+to+Xata+using+Greenmask.\u0026amp;theme=a98dfbe8d11c1328e16cdb2b\u0026amp;signature=a27edc5f2084d32244cb6df998d98f6cc32827f0bdf1196528987dfe3178db62\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/xata/aBhvMQRuTYnJZzL3/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Xata\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#735adc\">\u003clink data-mint-head rel=\"canonical\" href=\"https://xata.io/docs/migrations/greenmask\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/migrations/greenmask.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://xata.io/#organization\",\"name\":\"Xata\",\"url\":\"https://xata.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/xata/rYmGPszzEBdWMgvX/logo/light.svg?fit=max\u0026auto=format\u0026n=rYmGPszzEBdWMgvX\u0026q=85\u0026s=4ef098482078f4153c39dc17dd26476b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://xata.io/docs#website\",\"name\":\"Xata\",\"url\":\"https://xata.io/docs\",\"publisher\":{\"@id\":\"https://xata.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://xata.io/docs/migrations/greenmask#webpage\",\"url\":\"https://xata.io/docs/migrations/greenmask\",\"name\":\"Greenmask (subsets)\",\"description\":\"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.\",\"dateModified\":\"2026-06-02T14:40:55.015Z\",\"isPartOf\":{\"@id\":\"https://xata.io/docs#website\"},\"breadcrumb\":{\"@id\":\"https://xata.io/docs/migrations/greenmask#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://xata.io/docs/migrations/greenmask#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Import and Migrate\",\"item\":\"https://xata.io/docs/migrations/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Greenmask (subsets)\",\"item\":\"https://xata.io/docs/migrations/greenmask\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://xata.io/docs/migrations/greenmask#article\",\"headline\":\"Greenmask (subsets)\",\"name\":\"Greenmask (subsets)\",\"description\":\"Learn how to import a referentially-consistent subset of your PostgreSQL database to Xata using Greenmask.\",\"url\":\"https://xata.io/docs/migrations/greenmask\",\"mainEntityOfPage\":{\"@id\":\"https://xata.io/docs/migrations/greenmask#webpage\"},\"dateModified\":\"2026-06-02T14:40:55.015Z\",\"publisher\":{\"@id\":\"https://xata.io/#organization\"},\"isPartOf\":{\"@id\":\"https://xata.io/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Xata\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Xata","nav":{"global":null,"tabs":[{"tab":"Guides","icon":"book-open","directory":"card","groups":[{"group":"Introduction","icon":"sparkles","root":{"title":"Xata Documentation","icon":"book","sidebarTitle":"Overview","mode":"frame","href":"/overview"},"pages":[]},{"group":"Get Started","icon":"rocket","pages":[{"title":"Quickstart","icon":"rocket","href":"/quickstart"}]},{"group":"Core Concepts","icon":"layer-group","pages":[{"title":"Branching","icon":"code-branch","iconType":"regular","href":"/core-concepts/branching"},{"title":"Data Anonymization","icon":"user-secret","href":"/core-concepts/anonymization"},{"title":"Schema Changes","icon":"database","href":"/core-concepts/schema-changes"},{"title":"Scale to Zero","icon":"pause","href":"/core-concepts/scale-to-zero"},{"title":"Serverless Proxy","icon":"bolt","href":"/core-concepts/serverless-proxy"},{"title":"Deployment Models","icon":"cloud","href":"/core-concepts/deployment"}]},{"group":"Branching Workflows","icon":"code-branch","pages":[{"title":"Create Branch","icon":"github","href":"/automations/ga-pr"},{"title":"Create a production clone","icon":"copy","href":"/tutorials/create-production-clone"},{"title":"Data Anonymization","icon":"user-secret","href":"/core-concepts/anonymization"},{"title":"Create Streaming Replica","icon":"right-left","href":"/tutorials/streaming-replication"},{"title":"Make Schema Changes","icon":"code-merge","href":"/tutorials/schema-change"},{"title":"Find and fix slow queries on a Xata branch","icon":"gauge-high","href":"/tutorials/find-slow-queries"}]},{"group":"Connect","icon":"plug","pages":[{"group":"ORMs","icon":"database","expanded":false,"pages":[{"title":"Use Xata with Drizzle","icon":"droplet","href":"/quickstarts/drizzle"}]},{"group":"Platforms","icon":"cloud","expanded":false,"pages":[{"title":"Use Xata with Netlify","icon":"cloud-arrow-up","href":"/quickstarts/netlify"},{"title":"Use Xata with Railway","icon":"train","href":"/quickstarts/railway"}]},{"group":"Tools","icon":"diagram-project","expanded":false,"pages":[{"title":"Use Xata with n8n","icon":"diagram-project","href":"/quickstarts/n8n"}]}]},{"group":"Manage","icon":"sliders","pages":[{"title":"Account Management","icon":"circle-user","href":"/platform/account"},{"title":"Organizations","icon":"users","href":"/platform/organization"},{"title":"Organization roles","icon":"user-shield","href":"/platform/organization-roles"},{"title":"API Keys","icon":"key","href":"/platform/api-key"},{"title":"MCP Server","icon":"plug","href":"/platform/mcp"},{"title":"Projects","icon":"folder","href":"/platform/project"},{"title":"Branches","icon":"code-branch","href":"/platform/branch"},{"title":"Compute","icon":"microchip","href":"/platform/compute"},{"title":"Schemas","icon":"sitemap","href":"/platform/schemas"},{"title":"Migrations","icon":"code-merge","href":"/platform/migrations"},{"title":"SQL Editor","icon":"magnifying-glass","href":"/platform/sql-editor"},{"title":"Query insights","icon":"chart-simple","href":"/platform/query-insights"},{"title":"Metrics","icon":"chart-line","href":"/platform/metrics"},{"title":"Extensions","icon":"puzzle-piece","href":"/platform/extensions"},{"title":"Logs","icon":"file-lines","href":"/platform/logs"},{"title":"AWS PrivateLink","icon":"lock","href":"/platform/privatelink"},{"title":"Single sign-on","icon":"shield-halved","href":"/platform/sso"}]},{"group":"Import and Migrate","icon":"database","pages":[{"title":"Overview","icon":"list","href":"/migrations/overview"},{"title":"AWS RDS","icon":"aws","href":"/migrations/aws-rds"},{"title":"AWS Aurora","icon":"aws","href":"/migrations/aws-aurora"},{"title":"GCP Cloud SQL","icon":"google","href":"/migrations/gcp-cloudsql"},{"title":"Azure Database","icon":"microsoft","href":"/migrations/azure"},{"title":"Self-Hosted PostgreSQL","description":"Learn how to migrate your self-hosted PostgreSQL database to Xata using xata clone.","icon":"database","href":"/migrations/self-hosted"},{"title":"Greenmask (subsets)","icon":"scissors","href":"/migrations/greenmask"},{"title":"Neon","description":"Learn how to migrate your Neon PostgreSQL database to Xata using xata clone","icon":"server","href":"/migrations/neon"},{"title":"Supabase","icon":"bolt","href":"/migrations/supabase"},{"title":"Parquet files","icon":"file","href":"/migrations/parquet"}]},{"group":"Workflows","icon":"gears","pages":[{"title":"GitHub App","icon":"github","href":"/automations/github-app"},{"title":"Vercel preview deployments","icon":"cloud-arrow-up","href":"/automations/vercel-github-app"},{"title":"Create Branch","icon":"github","href":"/automations/ga-pr"},{"title":"Scheduled Clone","icon":"github","href":"/automations/ga-clone"},{"title":"Merge Readiness","icon":"github","href":"/automations/ga-check"},{"title":"Scheduled Clone","icon":"calendar","href":"/automations/kubernetes-clone"},{"title":"Bulk Delete Branches","icon":"github","href":"/automations/ga-cleanup"}]},{"group":"AI Agents","icon":"robot","root":{"title":"Xata for Agents","icon":"robot","href":"/ai-agents/overview"},"pages":[{"title":"Agent onboarding","icon":"wand-magic-sparkles","href":"/ai-agents/onboarding"},{"title":"Agent Skills","icon":"star","href":"/ai-agents/agent-skills"},{"title":"Claude Code","icon":"terminal","href":"/ai-agents/claude-code"},{"title":"Codex","icon":"code","href":"/ai-agents/codex"},{"title":"Cursor","icon":"arrow-pointer","href":"/ai-agents/cursor"},{"title":"OpenCode","icon":"terminal","href":"/ai-agents/opencode"},{"title":"GitHub Copilot","icon":"github","href":"/ai-agents/github-copilot"},{"title":"Windsurf","icon":"wind","href":"/ai-agents/windsurf"},{"title":"Cline","icon":"check-double","href":"/ai-agents/cline"},{"title":"Devin","icon":"cloud","href":"/ai-agents/devin"}]},{"group":"Reference","icon":"book","pages":[{"title":"Changelog","icon":"ship","href":"/changelog"}]}]},{"tab":"API Reference","icon":"terminal","pages":[{"title":"API Reference","href":"/api-reference/organizations/get-list-of-organizations"}]},{"tab":"CLI Reference","icon":"square-terminal","pages":[{"title":"CLI Reference","href":"/cli"}]},{"tab":"Open Source","icon":"code-branch","menu":[{"item":"pgstream","icon":"right-left","description":"Postgres replication with schema-aware streaming.","pages":[{"title":"pgstream","href":"/opensource/pgstream/overview"}]}],"pages":[{"title":"Open Source","href":"/opensource/pgstream/overview"}]}]},"title":"Greenmask (subsets) - Xata","buildId":"dpl_GvhK4qVXq51DpfYJLCtPpYNN4YHN","deploymentId":"dpl_GvhK4qVXq51DpfYJLCtPpYNN4YHN","dynamics":[],"chunks":[]}