Palbase Machines · API
/databases/{name}/moveMove a database to another environment of its project
Binds the database to another environment of its project: its metadata, billing attribution, and primary host become the new environment's within seconds, while the underlying data stays in place without copying and continues answering throughout. Its host names the new environment from then on (<name>-<the environment's ref>), and its former host continues answering as well (former_hosts); attached machines roll out with the updated host beside the version that serves. Any machines running migrations against this database move with it when with_machines is set — moving together with the database — or the move is refused (migrations_where_kept). A pull request preview's own database cannot be moved (preview_database); one being resized, restored or archived moves once that finishes (database_busy). The new environment must have capacity for it (too_many_databases, size_not_available, backup_days_not_available) and no database of its name (name_taken). Meanwhile changes are refused (409 database_moving), and moving to its current environment cancels a pending move. It needs the admin role in both environments (environment_role_required); an environment-scoped token or key cannot move resources out of its environment (environment_not_found). A move that cannot be completed is canceled with the reason in move_note.
Called by your server, with the project's secret key.
Path
namestring · requiredThe database's name: lowercase letters, digits and dashes, starting with a letter and not ending with a dash, 32 at most.Request body
environmentstring · requiredThe ref of the environment of the project the database moves to.with_machinesboolean · optionalMoves the machines of its environment that run its migrations with it, in one step: they move once it has, its migrations theirs where it moves. Without it, a move such machines would be left behind by is refused (migrations_where_kept).curl -X POST "https://<your-ref>.palbase.studio/databases/<name>/move" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"environment":"string"}'Responses
200A move to its own environment: the move let go of.
202Moving: the database, moving_to naming the environment it moves to.
400Validation failed or a required field is missing
401Missing or invalid API key
403Not the project's secret key; or the request requires elevated owner authentication (`owner_only`, `insufficient_user_authentication`).
404The project has no machine of this name
409The project already has a machine of this name, or has as many machines as it may
429Over the project's request limit, or its machine time for this period is used up
503Temporarily unavailable; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation MoveDatabase of machines's contract.