Skip to content

Implement database copy via CreateBackup→RestoreDatabase or DUMP-based copy #662

Description

@apstndb

Rewrite of #288, whose core premise was incorrect: there is no CopyDatabase RPC in the Spanner Database Admin API (verified against cloud.google.com/go/spanner v1.91.0 databasepb — only CopyBackup exists), so the statement set proposed there cannot be implemented as designed.

Viable designs

  1. Backup/restore chaining: CreateBackupRestoreDatabase (+ optional CopyBackup for cross-instance). Both are LROs, so progress display can reuse the existing ShowOperationStatement / operation-listing patterns (statements.go). Restrictions apply (same instance config family, retention limits).
  2. DUMP-based copy: export through the existing DUMP pipeline (statements_dump.go) and replay into the target database. Slower, but works across configs and to the emulator.

A minimal first statement could be COPY DATABASE <src> TO <dst> implementing strategy 1 only, with strategy 2 as a follow-up or an explicit option.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestoperationsDatabase operations and management features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions