# Transfer a website between you and your accounts

> Source: https://www.allsweb.com/sixpanel/docs/transfer-a-website
> Markdown for agents: https://www.allsweb.com/sixpanel/docs/transfer-a-website.md
> Publisher: AllsWeb (www.allsweb.com)

Part of: SixPanel documentation

**What this page is for:** giving one of your websites to a reseller or a user, taking one back, and moving a
website from one account to another while it keeps serving, without the previous owner keeping a way in.

**You need**

- A website of one of these kinds: static website, Node.js app, PHP website, WordPress, Python app or Java
  app. A Docker app, a reverse proxy and a Create with AI website stay yours, and a 6amMart project is never
  transferred.
- An account to give it to ([Accounts: resellers and users](https://www.allsweb.com/sixpanel/docs/accounts-and-reseller)), or the website
  already belongs to one and you want it back.

---

## Who can transfer what

| Who | What they can transfer |
|---|---|
| You, the owner | Any website, in every direction: yours to an account, an account's back to you, one account's to another (also between two resellers) |
| A reseller | Inside its own accounts only: its own websites to its users and back, and one user's website to another user |
| A user | Nothing. Ask the owner or your reseller |

## Transfer a website

1. Open the website and go to **Settings**. The **Owner** card says whose it is and lists its last owners.
2. Press **Transfer website** and pick who it goes to. On the **Accounts** page, **Hand a website to this
   account** and **Take back** open the same dialog.
3. Read the checks. Each one has a ✓, a ✗ or a !:
   - **Package room**: the account's package must have room for everything the website brings: the website
     itself, its databases, mailboxes, FTP users and disk, each shown as `used → after of limit`. A reseller's
     user is also counted against the reseller's totals when the website comes from outside that reseller.
     A website whose size SixPanel has not measured lately (often one of yours) is measured when you open
     the check, which can take a few seconds. If it cannot be measured, the check says so and refuses; try
     again in a minute.
   - **Domain names**: a name under a domain another of your websites uses is refused when a reseller
     transfers it. When you transfer it you get a warning and tick that you accept it.
   - **Staging sites** stay yours: delete them on the website's **Staging & Testing** page first.
   - **A running job** (a deploy, a backup) or an **AI Coding turn** working on it: wait for it to end.
   - **A suspended account**, or one whose reseller is suspended, receives nothing until it is unsuspended.
     A reseller cannot move a website out of an account you suspended, either: only you can.
4. Read what is closed for the previous owner and what happens to the repository (below), and tick what you
   want.
5. Type the website's short name (shown above the field) and press **Transfer**. The dialog ticks each step
   as it finishes and then says how it ended. You can close it at any time: the transfer goes on, and the bar
   at the top of the panel shows it. **Watch the log** opens its full log. The website belongs to its new
   owner from the moment you press it; the job then closes the old access and moves the app.

Tia can do the same: ask her "transfer shop.example.com to the account acme". She shows the checks first and
waits for your yes on a card that says what will be closed.

## What changes, and what does not

**Stays exactly as it is:** the domains and their certificates, the files, the release that is live, the
database contents, the cron jobs, the backups and restore points, and the Linux account the website runs as.
Visitors notice nothing.

**Moves with it:** its databases, FTP users, cron jobs and AI Coding sessions. Tick **Clear its AI Coding
history** to remove the sessions instead.

**Its new limits:** the website runs inside its new account's limits (CPU, memory, processes, PHP workers).

**It keeps serving.** A Node.js, Python or Java app is started on its second slot inside the new account's limits,
with its new passwords. Visitors move to it the moment it answers, and the old slot then stops. A PHP website's
PHP pool is reloaded gracefully, so requests already running finish. An app with only one slot is restarted,
and the dialog says so before you press.

**A PostgreSQL password changes with nobody refused.** PostgreSQL keeps one password per user, so the panel gives
the app a stand-in login for the move: the app starts on its other slot signed in by the stand-in, the user's
password changes while nothing is signed in by it, the app moves once more signed in by the user with the new
password, and the stand-in is removed. The app therefore moves twice, and the transfer takes about twice as long;
visitors notice neither move. The stand-in is the same user to the database (what the app makes belongs to the
user, with the user's own settings), and the transfer's log says when it is made and when it is gone.

**Where a password still changes in one move:** a MongoDB or SQL Server database, a PostgreSQL database of a PHP
website or of an app with one slot, and a PostgreSQL password that one of your own variables holds (an address you
typed yourself names the user beside it, so the app cannot be given another login). Connections already open keep
working, but a new connection in the seconds until the app has moved is refused, and an app that opens a new
connection for each request answers those requests with an error. The dialog says so before you press, and the
transfer's log names the database and the seconds until visitors moved.

## The previous owner's access is closed

When an account will no longer see the website after the transfer, **Close the previous owner's access** is
ticked, and the transfer:

- switches its **FTP and SFTP users** off and gives them a new password nobody is shown. The new owner sets a
  password and switches them on again on the website's **SSH/FTP** page;
- changes its **database passwords** and gives the new ones to the app. Every MariaDB database of the website
  accepts both the old and the new password while the app moves over, so no request fails. After that, only the
  new one works. Wherever the website's own settings hold an old password (its `.env`, or a variable you added
  to a Node.js, Python or Java app), it is replaced with the new one first;
- changes its **Redis password** the same way, its `.env`'s `REDIS_PASSWORD` included;
- renews the **deploy webhook's secret**. Put the new secret in your repository's webhook: **Deploys →
  Automatic deploys** shows it;
- revokes the **MCP tokens** that were limited to this website. A token that also names other websites only
  loses this one;
- lists the **SSH keys** you added for the website, each ticked to be removed. Untick one to keep it. When
  a key is removed, the SSH and SFTP sessions open on the website's account end too;
- on a **WordPress** website, gives the administrator SixPanel made a new password nobody is shown (its
  **WordPress** page shows it to the new owner), and shuffles its keys and salts. Everybody signed in to
  WordPress signs in again, the previous owner too. The dialog lists the website's WordPress administrators:
  remove any the previous owner made on the **Users** page in WordPress.

A **live log** the previous owner still has open on the website's **Logs** page (**Live, as it is written**)
stops within a few seconds of the transfer when that account no longer sees the website: the panel asks again,
every few seconds while it is open, whether the account may still open it. The same happens when the website
is deleted, or the account is deleted or suspended.

**The repository stays connected.** A saved repository token, or the website's deploy key, keeps pulling the
repository it was saved for, so deploys keep working after the transfer. The new owner never sees the token,
and it only reaches that one repository. Tick **Remove the saved repository token** when the new owner should
connect the repository with their own token (the next deploy needs it). A deploy key stays in that
repository's settings until somebody removes it there. The **Activity** page says whether the token was kept,
and names each domain warning you accepted.

**A private npm package's token is different.** A Node.js website deployed from an npm package with a saved
access token hands that token to the install, which runs as the website, and the new owner's scheduled tasks
run as the website too, so they could read it while a deploy installs. The dialog names the package and
ticks **Remove the saved npm token**; untick it only when the new owner may use that token. Tia, the command
line and the API remove it too unless told to keep it, whenever the previous owner's access closes, and so
does deleting an account whose websites move. Removed, the next deploy of the private package
needs the new owner's own token (**Deploys**, where the package is chosen); the package itself stays.

The dialog also lists the **names** of the variables the previous owner could read (never their values).
Change any secret they should not keep on the website's **Environment** page.

**Mailbox passwords are kept**: they belong to the business's staff.

**When both accounts are the same customer**, untick **Close the previous owner's access**. Nothing is closed
and no password changes.

**A PHP website whose `.env` does not name its database**: its own code holds the database password, so the
dialog warns you and asks you to accept it. After the transfer, put the new password in that code (the
website's **Database** page shows it), or untick **Close the previous owner's access**. The same warning names
any other database user, or the Redis password, that the website's settings do not hold.

**Nobody loses the website** when you give one of your own websites to an account, or when a reseller hands
its own website to one of its users. Nothing is closed then.

## If something goes wrong

- **"Its package has no room for this website"**: raise the package on the **Accounts** page, or free
  something in the account first.
- **A step failed in the drawer**, or the panel restarted in the middle: the website already belongs to its
  new owner and keeps serving, and the **Owner** card says the transfer did not finish, because the previous
  owner's access may still be open. Fix what the step says, then press **Finish it**: the steps run again, as
  you decided them, with the SSH keys and the AI Coding history you ticked. **Show its job** opens the step that stopped.
  Until it finishes, another transfer of the website is refused ("its last transfer did not finish"), from the
  dialog, the API, the command line and Tia alike: a new one would not close what this one left open.
  On the server's command line, `sudo sixpanel site <short-name> transfer --finish` is the same **Finish it**.
- **The new release did not answer on its other slot**: the app that was serving keeps serving. The job says
  why, and which passwords it serves with: the ones it had (every changed one is put back), or, when it had
  already moved to a PostgreSQL stand-in login, that login and the new MariaDB passwords it was started with
  (those stay, as the next point says); the stand-in keeps working until **Finish it** changes the password and
  removes it. Fix the app, then press **Finish it**.
- **A step failed after the app had already started again**: a password goes back only while the app that
  serves was started before it changed. One the app already runs with stays, so the website keeps reaching its
  databases and Redis, and the job says which: "its app already runs with the new password of …, which stayed"
  after the first of two moves, or "its app already runs with every new password, so none was put back" after
  the last one (Redis did not withdraw its previous password, or MariaDB did not refuse one). Where it says a
  database or Redis "still accepts the previous one beside it", the previous owner's password works there until
  you press **Finish it**, which changes every password once more and ends the previous ones.

## For the command line and the API

- `sixpanel site <slug> transfer --to <account username|owner>` as root over SSH: the same transfer,
  for when the panel's pages are out of reach. It prints the checks and what is closed, stops on a ✗, and
  asks you to type the website's short name. `--accept` transfers it despite a warning, `--keep-access`
  closes nothing (both accounts are the same customer), `--remove-repo-token` removes the saved repository
  or npm token and `--keep-repo-token` keeps it (with neither, a repository token stays and an npm token is
  removed when access closes; the printed lines say which), and `--yes` confirms without a terminal. Then it follows the job's log. `sixpanel help site` has
  the rest.
- `GET /api/sites/<id>/transfer/preview?to=<account username or id, or owner>`: every check, what moves, and
  what is closed. Nothing changes.
- `POST /api/sites/<id>/transfer` with `{ "to": "<account or owner>", "confirm": "<the website's short
  name>", "closeAccess": true, "clearAiHistory": false, "removeSshKeys": ["<key id>"], "removeRepoToken":
  false, "accept": false }` runs the transfer (`"removeRepoToken": true` removes a saved repository or npm token
  and `false` keeps it; left out, a repository token stays and an npm token is removed when access closes). Every check is asked again by the panel, and a request
  without the short name in `confirm` is refused. Add `"from": "<the owner the preview showed>"` and a
  website that changed hands since you read the preview is refused instead of moved.
- With an API key (a billing system, your own program): `GET /api/v1/websites/<id>/transfer/preview?to=…`
  and `POST /api/v1/websites/<id>/transfer`, the same transfer for a key holding `websites:transfer`, between
  the accounts that key reaches. The chapter "The SixPanel API" has the worked example and every refusal.
