# POST /move/copy

First published 3 Oct 2026 (release 0.1.0) · Last changed 25 Nov 2026 (release 0.2.33)

UrbeStack release 0.2.35 API operation in the move group.

Start a job to copy accounts while the source keeps serving them

- Who may call it: administrator
- Token scope, any of: users, all
- Answers: 202 Accepted

Returns 202 with the job in job. This is the first phase of a move and can be repeated before cutover. Copying a reseller also copies their customers, with the reseller copied first. The job checks that account names and domains are available on the destination and that the required software is installed. If software is missing, the job fails and lists the installation commands in the order to run them.

The job lowers the TTLs of the account's zones on the source to five minutes. It imports account records and secrets, installs the existing certificates, and stages the account as suspended on the destination. Cron jobs and mail handling stay on the source until cutover. The job copies the home directory, including sites and mail, using rsync over SSH. It dumps each database on the source and loads it on the destination. Later copies transfer new and changed files and remove data deleted from the source since the previous copy. A failed copy can affect only zone TTLs on the source.

For zones whose nameservers are hosted elsewhere, the job result lists the DNS records to update manually at cutover.

Set profile to true to import the source server's settings and packages before copying accounts. With profile alone, the job imports the profile without copying accounts. Use GET /move/profile to preview the changes and identify settings marked names_old_server. Omit settings to import all settings, or supply an array of setting keys to import just those settings. An empty array selects zero settings. Packages are imported in full regardless of the setting selection.

The job leaves hooks, overrides, custom includes, and registered files for root to review. The result lists them in profile.left_for_root and provides the rsync command to fetch them into /root/urbestack-review. After reviewing the files, use urbestack-move-copy --profile --trust-files to import them.

Supply a nonempty users array of source account names, set all to true, or set profile to true. Use as to map selected source account names to their destination names. Returns 400 if none of these selections is made, users and all are combined, users is not an array, as is not an object or names an account outside users, or settings is not an array or is supplied without profile.

Requires a token with the users scope. Returns 403 if the caller lacks administrator privileges.

## Request body

JSON, the type [MoveCopyRequest](https://urbestack.com/docs/api/types/MoveCopyRequest.md).

- `all` (boolean): Whether to copy every source account that has yet to move. Use this in place of users.
- `as` (object of Username): The as field maps source usernames in users to destination usernames when the source username is taken, reserved or invalid on the destination. After the first copy under the chosen username, UrbeStack automatically reuses it for later copies and cutover and refuses a different username.
- `profile` (boolean): Whether to copy the source server's settings and packages before copying accounts, or by themselves when no accounts are selected. UrbeStack leaves hooks, overrides, custom includes and registered files in the profile for root to review and apply. The job result lists those items, the rsync command to fetch them and the shell command to apply them.
- `settings` (array of string, matching ^[a-z][a-z0-9_]{0,31}(\.[a-z][a-z0-9_]{0,31}){0,3}$): Keys of the settings to copy when profile is enabled. An empty list copies no settings and omitting settings copies them all. UrbeStack copies all packages regardless of this selection.
- `users` (array of SourceUsername): Source server usernames of the accounts to copy. Selecting a reseller also copies their customers.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/move/copy" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "all": true,
    "as": {},
    "profile": true,
    "settings": [
      "text"
    ],
    "users": [
      "text"
    ]
  }'
```

Response, 202 Accepted:

```
{
  "job": {
    "created_at": "2026-09-09T10:15:00Z",
    "created_by": 1,
    "created_by_name": "text",
    "dismissed_at": "text",
    "finished_at": "2026-09-09T10:15:04Z",
    "id": 1,
    "lane": "short",
    "log": "",
    "params": {},
    "progress": 100,
    "result": {},
    "started_at": "2026-09-09T10:15:01Z",
    "status": "queued",
    "type": "rebuild",
    "usual_seconds": 1
  }
}
```

## Errors

- 400: A new job is queued or running
- 400: Invalid <what>: 
- 400: Invalid setting key
- 400: Invalid source username: 1 to 32 lowercase letters, digits, underscores or hyphens, starting with a letter
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Job parameters must be an object
- 400: Name the accounts in users, or all; or profile alone for the source server's settings and packages
- 400: Unknown job type
- 400: Username '<value>' is reserved
- 400: as goes with users
- 400: as is an object: the name on the source server, and the name the account takes here
- 400: as names <o>, which is not among users
- 400: settings goes with profile
- 400: settings is a list of setting keys
- 400: users and all exclude each other
- 400: users is a list of account names
- 401: Authentication required
- 403: Insufficient privileges
- 404: User '<user>' not found

## Change log

Most recent first.

- 0.2.33 · 25 Nov 2026 · The operation rejects names this server cannot assign before copying. The operation reports all affected accounts without a replacement name in as before doing any work on the source server. Previously, the copy stopped when it reached the first such account.
- 0.2.33 · 25 Nov 2026 · Account names use the source server’s names. Each name in users is the account’s name on the source server and must be 1 to 32 characters long, start with a letter and contain only lowercase letters, digits, underscores or hyphens. If this server cannot assign that name, provide a replacement name in as. (from named type [`MoveCopyRequest`](https://urbestack.com/docs/api/types/MoveCopyRequest.md))
- 0.1.0 · 3 Oct 2026 · First published.
