COPY FROM DATABASE (OVERWRITE)
The COPY FROM DATABASE ... (OVERWRITE)
statement will make the target_db contain exactly the same data as source_db via zero-copy cloning, effectively overwriting it.
This command will wait on any ongoing write transactions on the target database to complete, and prevent new ones from starting while it is in progress.
Note: The syntax is supported in MotherDuck only, as it operates on a MotherDuck metadata level.
Syntax
COPY FROM DATABASE <source_database> (OVERWRITE) [ TO <target_database> ]
Parameters
<source_database>
: The name or path of the source database to copy from, can be either a MotherDuck database or a share.<target_database>
: The name or path of the target database to create, must be a MotherDuck database that the user owns.