---
title: Upgrade Databases
url: https://docs.vultr.com/products/storage/databases/postgresql/management/upgrade-databases
description: Learn how to schedule and manage database version upgrades for your Vultr Managed PostgreSQL databases.
publish_date: 2024-09-23T20:21:42.131099Z
last_updated: 2026-05-26T19:43:51.691312Z
---

# How to Manage Upgrade Window for Vultr Managed Databases for PostgreSQL

Managing the Upgrade window for Vultr Managed Databases for PostgreSQL allows you to set a suitable day and time when your managed database upgrades to the newest version. Upgrading improves security, fixes bugs, and downloads new features. You should set the upgrade schedule when your database application is less busy to avoid downtime for the end-users.

Follow this guide to manage upgrade window for Vultr Managed Databases for PostgreSQL using Vultr Console, API, CLI, or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and select **Databases**.
    1. Click the target database instance.
    1. Click **Settings** and **Upgrade Window**. 
    1. Select the day of the week and the time and click **Apply Changes**.

=== "Vultr API"

    1. List all the database instances by sending a `GET` request to the [**List Managed Databases** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/list-databases) and note the database ID. For example, `43b4c774-5dff-4ac0-a01f-78a23c2205b5`.

        ```console
        $ curl "https://api.vultr.com/v2/databases" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `PUT` request to the [**Update Managed Database** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/update-database) to change the maintenance day of the week (`maintenance_dow`) and time (`maintenance_time`) for the database and specify the database ID.

        ```console
        $ curl "https://api.vultr.com/v2/databases/database_id" \
            -X PUT \
            -H "Authorization: Bearer ${VULTR_API_KEY}" \
            -H "Content-Type: application/json" \
            --data '{
                "maintenance_dow" : "sunday",
                "maintenance_time" : "01:00"       
            }'
        ```

        Visit the [**Update Managed Database** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/update-database) to view additional attributes to add to your request.

=== "Vultr CLI"

    1. List all database instances and note the database ID. For instance, `d6ac2a3c-92ea-43ef-8185-71a23e58ad8c`.

        ```console
        $ vultr-cli database list --summarize
        ```

    1. Update the maintenance day of the week and time by specifying the database ID.

        ```console
        $ vultr-cli database update database_id \
        --maintenance-dow sunday \
        --maintenance-time 01:00
        ```

        Run `vultr-cli database update --help` to view all options.

=== "Terraform"

    1. Open your Terraform configuration for the existing Managed Database for PostgreSQL resource.

    1. Add or update the `maintenance_dow` and `maintenance_time` arguments.

        ```terraform
        resource "vultr_database" "pg" {
            # ...existing fields (database_engine, region, plan, label, etc.)

            maintenance_dow  = "sunday"
            maintenance_time = "01:00"
        }
        ```

    1. Apply the configuration and observe the following output:

        ```
        Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
        ```
