Upgrade to a newer major version
curl --request POST \
--url https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"version": "19"
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade"
payload = { "version": "19" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: '19'})
};
fetch('https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => '19'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade"
payload := strings.NewReader("{\n \"version\": \"19\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"19\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"19\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"database": {
"database_id": "a1b2c3d4",
"name": "orders-db",
"engine": "postgres",
"engine_version": "18",
"status": "upgrading",
"status_message": "Upgrading to PostgreSQL 19: taking a backup first",
"upgrade_versions": [
"19"
],
"upgrade_note": "",
"last_version_upgrade": {
"from_version": "18",
"to_version": "19",
"state": "backing_up",
"message": "",
"started_at": "2026-11-25T10:00:00Z",
"finished_at": ""
}
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Databases
Upgrade database
Upgrade a PostgreSQL database to a newer major version, in place. Other engines are refused.
Before upgrading, get the versions this database can take from upgrade_versions in Get database. When it is empty, upgrade_note says why.
The upgrade is asynchronous: the call answers at once with the database in status upgrading. Poll GET /api/v1/databases/{database_id} until status is running, then read last_version_upgrade.state.
- Backup first: a backup is taken before anything changes. It is listed with
backup_typebefore_upgrade. - Offline while it upgrades: about a minute for a small database, longer with many tables.
- If it cannot complete: the database returns to its version by itself, unchanged.
last_version_upgrade.stateisfailedandmessagegives the reason. - Afterwards: extensions are updated, statistics are refreshed and a new backup is taken (
after_upgrade). A standby and read replicas are rebuilt after the upgrade.
Nothing is ever upgraded automatically. To go back afterwards, restore a backup whose before_upgrade is true with POST /api/v1/databases/{database_id}/restore: over the database (it returns to the older version) or as a new database.
Errors
400:versionis missing, or not one of this database’supgrade_versions.412: the database cannot be upgraded right now, with the reason in plain words. For example: it is not running; it is already being upgraded; a column uses a type PostgreSQL cannot carry to a new major version (the message names the columns).
POST
/
api
/
v1
/
databases
/
{database_id}
/
upgrade
Upgrade to a newer major version
curl --request POST \
--url https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"version": "19"
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade"
payload = { "version": "19" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: '19'})
};
fetch('https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => '19'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade"
payload := strings.NewReader("{\n \"version\": \"19\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"19\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/databases/{database_id}/upgrade")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"19\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"database": {
"database_id": "a1b2c3d4",
"name": "orders-db",
"engine": "postgres",
"engine_version": "18",
"status": "upgrading",
"status_message": "Upgrading to PostgreSQL 19: taking a backup first",
"upgrade_versions": [
"19"
],
"upgrade_note": "",
"last_version_upgrade": {
"from_version": "18",
"to_version": "19",
"state": "backing_up",
"message": "",
"started_at": "2026-11-25T10:00:00Z",
"finished_at": ""
}
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Body
application/json
Last modified on November 25, 2026