Upgrade a database
Moves a database to a newer version of its engine on the same server, e.g. from MariaDB 12 to MariaDB 13 or from PostgreSQL 18 to PostgreSQL 19, with its name, username, password and hostname unchanged.
When your provider installs a newer version, new databases go on it at once, unless you pick an older version your provider still offers. A database you already have stays on its version until you upgrade it. Your provider may also upgrade it for you, and remove the old version once no database is left on it.
When it's offered
A database that has a newer version available shows it at the top of its page, e.g. PostgreSQL 18.7 — PostgreSQL 19.0 is available on this server, with an Upgrade button. The button opens a page that tells you what the upgrade will do for this database: how long it will be read-only, and any application that would lose its connection. Nothing starts until you confirm there.
The upgrade page refuses to start, and says why, when:
- a PostgreSQL database uses an extension that the newer version doesn't provide
- the server doesn't have room for a second copy of the database for a while
- the database is read-only for another reason, e.g. a move is copying it
A Valkey store isn't upgraded: it holds temporary data, so there's nothing to carry over.
What happens
The panel copies the database to the newer version, on the same server, then checks the copy and switches to it:
- The database becomes read-only.
- Its content is copied into a new database on the newer version.
- Both copies are compared, table by table: every table must have the same number of rows on both sides.
- The database switches to the new copy, which is writable. Its hostname now points at the newer version.
The database's page follows the steps as they run. Upgrades on a server run one at a time, so yours can wait as Queued while another database is being copied.
You get a notice in your system mailbox when the upgrade has finished or failed, also when your provider started it.
The read-only window
From the start of the copy until the switch, the database accepts reads and refuses writes. A site that only shows pages keeps working. A site that saves something, e.g. a comment, an order, or a sign-in that records the time, shows a database error for that request, which depends on the engine:
| Engine | A write during the window |
|---|---|
| PostgreSQL | Fails as a read-only transaction: cannot execute INSERT in a read-only transaction. |
| MariaDB | Fails as a permission error: INSERT command denied to user 'acme_shop'@'…'. |
Reads may call the database's stored functions and procedures; one that writes is refused like any other write.
The database's connections that are open when the window starts are closed, so an application that keeps a connection open connects again.
The upgrade page estimates the window from the size of the database. For the databases of a typical site it's well under a minute; for a large one it can be several minutes.
The window is short but not zero. Choose a time when few people use the sites that write to the database.
Use the hostname, not an address
The panel moves the database's own hostname, acme_shop.db.internal, to the
newer version at the switch. An application that connects to that hostname
needs no change, and neither does anything else: the database name, the
username and the password stay the same.
Each version runs as its own server with its own address and name, e.g.
10.91.3.102 and postgres-18.db.internal, or 10.91.3.101 and
mariadb-12.db.internal. An application configured with either of those
keeps connecting to the old copy, which stops accepting connections at the
switch. Change its database host to the database's
hostname before you upgrade.
The upgrade page warns about the WordPress sites it knows that are configured this way. For any other application, check its configuration yourself.
This applies to an SSH tunnel too. Forward to the database's hostname, as the command on the database's page does:
ssh -p PORT -L 5432:acme_shop.db.internal:5432 acme@server.example.com
The name is resolved on the server when the tunnel connects, so the same command reaches the database before and after the upgrade. A tunnel that is open during the switch keeps the old connection: close it and open it again.
While it runs
The database can't be deleted or restored, from an upload or from a backup, and its password can't be changed. The upgrade copies the database as it is, so any of these would be lost or would race the copy. You can still edit its note.
Abandon on the database's page calls the upgrade off, until it has switched. The copy on the newer version is deleted and the database stays where it was, writable.
If it fails
The database stays on its version, writable, as it was before; the copy on
the newer version is deleted. The database's page shows the first error the
database server reported, e.g. role "reporting" does not exist for an
object that refers to something only the old server has. Fix the cause and
upgrade again.
A newer version can reserve words that were ordinary names before:
MariaDB 13 reserves CONVERSION and TO_DATE. A stored procedure,
function, trigger or event that uses one of them unquoted, e.g.
SELECT conversion FROM rates, can't be created on the newer version, so
the upgrade fails and the database is left as it was. The error is a syntax
error at or just after the name, e.g. You have an error in your SQL syntax; … near 'conversion FROM rates …'. Quote the name with backticks,
`conversion`, in the routine, trigger or event, and upgrade again.
An application's own queries that use such a name unquoted fail the same way once the database has switched. Quote it there too before you upgrade.
After the switch
The old copy is kept for 7 days, unused: nothing can sign in to it. Then it's deleted. The database's page says until when.
You can't switch the database back to the old copy. Until the old copy is deleted, your provider can still read it, so ask them if you find something missing.
From the API and the MCP server
POST /api/v1/databases/{id}/upgrade starts an upgrade, GET on the same
URL follows it, and DELETE calls it off. The same operations are the MCP
tools database_upgrade, database_upgrade_status and
database_upgrade_abandon. A database's details include
upgradeAvailableTo, the newer version it can move to, and upgrade, its
most recent upgrade. See the API and
the MCP server.