diff --git a/documentation/changelog.mdx b/documentation/changelog.mdx index 5d2ed424d..a0bdd6bc9 100644 --- a/documentation/changelog.mdx +++ b/documentation/changelog.mdx @@ -17,7 +17,7 @@ This page tracks significant updates to the QuestDB documentation. ### New - [Migrate QuestDB onto the Kubernetes Operator](/docs/enterprise-kubernetes-operator/getting-started/migrate/) - Move an existing Enterprise deployment onto the Operator with a replica-first cutover: restore the source backup, consume replication WAL, then promote after a controlled source drain -- [Copy a schema to another instance](/docs/cookbook/operations/copy-schema-between-instances/) - Recreate one instance's tables, views, and materialized views on another from `SHOW CREATE DATABASE`, either by replaying the statements over the REST API or by dumping them to a `.sql` file, with `INCLUDE (SCHEMA)` and `INCLUDE (ACL)` for separating structure from permissions on Enterprise +- [Copy a schema to another instance](/docs/cookbook/operations/copy-schema-between-instances/) - Recreate one instance's tables, views, and materialized views on another from `SHOW CREATE DATABASE`, either by replaying the statements over the REST API or by dumping them to a `.sql` file, with `INCLUDE (SCHEMA)` and `INCLUDE (ACL)` for separating structure from permissions on Enterprise, plus the Web Console schema explorer as a manual alternative and the ordering caveat that comes with it ### Updated diff --git a/documentation/cookbook/operations/copy-schema-between-instances.md b/documentation/cookbook/operations/copy-schema-between-instances.md index 975a374db..7a1438dc2 100644 --- a/documentation/cookbook/operations/copy-schema-between-instances.md +++ b/documentation/cookbook/operations/copy-schema-between-instances.md @@ -131,10 +131,33 @@ Passwords and tokens are never dumped, so `CREATE USER` and `CREATE SERVICE ACCOUNT` statements replay without credentials. Set those on the target after the replay. +## Manual alternative: copy from the Web Console + +For a one-off copy, or when you only want a few objects, the +[schema explorer toolbar](/docs/getting-started/web-console/schema-explorer/#toolbar) +puts the DDL on your clipboard with no scripting: + +1. Click **Select Mode**, the checkbox circle icon in the toolbar. +2. Click **Select all**, the circle icon, or tick individual objects. +3. Click **Copy schemas to clipboard**. + +Paste the result into an editor, or straight into the target's Web Console and +run it. Selection mode exits once the copy succeeds. + +:::warning Reorder chained materialized views first + +The Web Console groups the copied statements by object type and sorts them +alphabetically within each group, not in dependency order. Tables always precede +materialized views, but a materialized view built on another materialized view +can be emitted before its own base. + +::: + :::info Related documentation - [`SHOW CREATE DATABASE`](/docs/query/sql/show/#show-create-database) - [REST API `/execute`](/docs/connect/compatibility/rest-api/#execute) +- [Schema explorer](/docs/getting-started/web-console/schema-explorer/) - [Copy data between instances](/docs/cookbook/operations/copy-data-between-instances/) - [Backup and restore](/docs/operations/backup/)