Move a site between Ploy workspaces

CLI & agents

Last updated

Use your coding agent and Ploy CLI 0.12.0 or newer to copy a site and its dependencies into another workspace.

Verify the copy, move traffic when ready, and delete the original only after confirmation.

The Ploy agent inside a workspace cannot perform this transfer because it has access to one workspace. Run the procedure from your own coding agent with browser-backed CLI login.

Before you start

  • Both workspaces must belong to the same organization. Copy and delete commands need admin or owner access to both. Moving a custom domain needs Member access or higher in both.
  • Run ploy update, check ploy --version, and sign in with ploy login. Workspace API tokens cannot perform cross-workspace operations. Organizations requiring SSO are currently unsupported.
  • Identify both workspace IDs and the source site ID. Keep the original until the destination is verified.
  • If the site writes to a database, arrange a write freeze for all consumers while copying and until cutover, or use a separately verified reconciliation plan. Database copies do not synchronize later writes.

Use the Ploy site skill

Install the public Ploy site skill (ploy-site) in the project where you run your coding agent:

Install the public Ploy site skill
npx skills add Ploy-AI/ploy-tools

Then ask your agent:

Use the ploy-site skill and its workspace transfer procedure to copy site <site-id> from workspace <source-id> to workspace <destination-id>. Inventory the code, unpublished work, databases, assets, environment, forms and documents. Show preservation gaps before writing. Validate the destination yourself, then let me verify before moving traffic or deleting the original.

The skill's workspace transfer procedure is the step-by-step reference for your agent, including dependency checks, CLI commands, and recovery steps. You can also give that link directly to your agent. Install the Ploy CLI separately. CLI 0.12.0's ploy skills init installs a different, site-specific skill bundle.

What the procedure covers

ResourceTransfer behavior
Site codeImport committed source into a new site and preserve unpublished edits separately. Original Git and deployment histories are not moved.
DatabasesCopy schema and records into an independent database. Create a new access key and update destination references. FILE columns are unsupported.
AssetsCopy the public-library assets used by the site, preserve shared source assets, and update destination URLs. Tracked public files travel with code. To move local files into the library, use ploy asset upload.
Variables and secretsCopy each deployment environment. Replace source database credentials before publishing.
FormsCopy captured submissions and, optionally, notification settings without sending email. Verify new submissions at the destination.
DocumentsCopy relevant Markdown and repair resource links. Comments, history, attachments, and connected integrations need separate handling.
Custom domainsMove the selected domain and its apex or WWW companion only after the destination passes verification. Verify routing and TLS.

Copy databases and environment values

A database copy needs a name and an operation key, plus both workspace IDs:

Copy a database and check progress
ploy database copy <source-database-id> \
  --from-workspace <source-workspace-id> \
  --to-workspace <destination-workspace-id> \
  --name "Copied database" \
  --operation-key <uuid> \
  --json

ploy --workspace <destination-workspace-id> \
  database operation <operation-id> --json
  • Reuse the same UUID if you retry the same copy.
  • Check progress with the operation ID the copy returns, in the destination workspace.
  • The copy receipt doesn't mean the copy finished. Keep source writes and schema edits paused until the operation succeeds.

To copy only some Variables and Secrets, pass --name to ploy env copy. See Copy values to another site.

Move the custom domain

Move the domain only after the destination passes verification:

Move a domain
ploy domain move example.com \
  --from-workspace <source-workspace-id> \
  --to-workspace <destination-workspace-id> \
  --from-site <source-site-id> \
  --to-site <destination-site-id> --json

You need Member access or higher in both workspaces, a published destination site, and a destination workspace that can use custom domains. Your organization's enhanced-security policy still applies.

A successful move transfers the apex and www pair and makes the hostname you named the canonical one. Then:

  1. Republish the destination site.
  2. Verify routing, canonical URLs, TLS, and form persistence on the destination.

A nonzero exit doesn't always mean nothing moved. The domain can belong to the destination while its edge setup is still incomplete. Before you delete anything at the source:

  • Read the receipt, including any warning about routing rules that point at other Ploy workers.
  • Inspect the domains on both sites.
  • Repair or save routing again, or republish the destination.

Running the move a second time does not repair edge setup.

Inspect domains on both sites
ploy --workspace <source-workspace-id> domain list --site <source-site-id> --json
ploy --workspace <destination-workspace-id> domain list \
  --site <destination-site-id> --json

Validate before cleanup

Test these on the published destination:

  • routes
  • mobile layout
  • images
  • database reads and writes
  • integrations
  • form persistence

New database access keys are created under Database options → Access keys → Create access key and bound with ploy secret set through stdin or its masked prompt.

Before you clean up:

  • The procedure uses separate copy and delete commands. There is no single atomic transfer.
  • Deleting a site preserves workspace-library assets and databases.
  • Delete a source database only when no remaining consumer uses it.
  • Keep required backups and history before approving cleanup.

To inspect one copied form submission, including its fields, use ploy form get. To remove a library asset you no longer need, use ploy asset delete. Deleting an asset can break pages that still use its URL. See the command reference.

Inspect a submission or delete an asset
ploy --workspace <workspace-id> form get <submission-id> \
  --site <site-id> --json
ploy --workspace <workspace-id> asset delete <asset-id> --json

If you need unchanged site identity, deployment history, private database files, or help resolving a failed operation, contact Ploy support before removing the source.

Move to another organization

To move a whole workspace to a different organization, contact Ploy support. Ploy support moves it for you. Ploy support may ask the current organization's owner to confirm the move.

  • What moves: the workspace's sites, chats, integrations, and settings move with it.
  • Who has access: members of the old organization lose access, members of the new organization gain access, and the owner of the new organization becomes the workspace's owner.
  • Invite people first: moving a workspace does not add anyone to the new organization, so invite people there first if they need access.
  • Check plan limits: billing then follows the new organization's plan, and that plan's limits apply, such as seats, sites, and experiments. Check those limits before you ask for the move.

Recovery

  • Default site unprovisioned: if a new workspace's default site remains unprovisioned and Git clone fails, inspect its state. Import into one new site with site init --from and record the unused empty default for approved cleanup.
  • HTTP 429: honor Retry-After. If it is absent, pause requests on that token for 60 seconds, then resume existing operation IDs and keys.
  • Before comparing output files: always check exit status and response content.

Keep going