> ## Documentation Index
> Fetch the complete documentation index at: https://planetscale.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Neki maintenance windows

> Weekly maintenance scheduling for production Neki branches.

Every production Neki branch has a weekly maintenance window. PlanetScale uses
this window for maintenance that can restart cluster components, including:

* Neki image updates.
* Postgres minor-version updates within the configured major version.
* Updates to default parameters and platform-managed configuration.

On a highly available shard, Neki performs a planned switchover before maintenance on the
primary. The switchover waits for a replica to catch up before promoting it,
which preserves commits made on the old primary. Maintenance can still close
active connections, so applications should reconnect automatically.

<Note>
  The maintenance window controls scheduled weekly maintenance. Configuration
  changes that you request in the dashboard, API, CLI, or Terraform apply
  independently of this window.
</Note>

## Change the weekly schedule

Maintenance windows use UTC. The dashboard also shows the corresponding time
in your configured local time zone.

<Frame>
  <img src="https://mintcdn.com/planetscale-2/6i1lJ6cNfB-VSsaH/neki/cluster-configuration/maintenance-windows.png?fit=max&auto=format&n=6i1lJ6cNfB-VSsaH&q=85&s=265c268fbc5ad3f5310cae26457d79da" alt="Settings Maintenance page showing the weekly schedule card for a production branch, with Change schedule and Run maintenance tasks now" className="block dark:hidden" width="2118" height="1110" data-path="neki/cluster-configuration/maintenance-windows.png" />

  <img src="https://mintcdn.com/planetscale-2/6i1lJ6cNfB-VSsaH/neki/cluster-configuration/maintenance-windows-darkmode.png?fit=max&auto=format&n=6i1lJ6cNfB-VSsaH&q=85&s=90d544144a9d8653dbc577172c106e0b" alt="Settings Maintenance page showing the weekly schedule card for a production branch, with Change schedule and Run maintenance tasks now" className="hidden dark:block" width="2118" height="1110" data-path="neki/cluster-configuration/maintenance-windows-darkmode.png" />
</Frame>

<Steps>
  <Step>From the PlanetScale dashboard, select your Neki database.</Step>
  <Step>Open **Settings**, then select **Maintenance**.</Step>
  <Step>Find the production branch and select **Change schedule**.</Step>
  <Step>Choose the day of the week and hour in UTC.</Step>
  <Step>Select **Save**.</Step>
</Steps>

The schedule card shows the previous maintenance window and the next scheduled
window. Only database administrators can change maintenance schedules.

## Run maintenance immediately

To apply available weekly maintenance without waiting for the next window,
select **Run maintenance tasks now** on the branch's schedule card.

Running maintenance immediately applies the same available updates as the
weekly schedule and can restart cluster components. Confirm that applications
can reconnect before starting it. Neki cannot start customer-requested
maintenance while a branch is sleeping.

Run branch-wide maintenance from the CLI with:

```bash theme={null}
pscale branch maintenance run <DATABASE> <BRANCH>
```

## Development branches

Development branches do not have configurable maintenance windows. Scheduled
maintenance uses PlanetScale's maintenance schedule for these branches.

## Related documentation

* [Cluster configuration](/docs/neki/cluster-configuration)
* [Postgres versions](/docs/neki/cluster-configuration#postgres-versions)
* [Replication and planned switchovers](/docs/neki/overview#the-admin)

## Need help?

Get help from [the PlanetScale Support team](https://planetscale.com/contact?initial=support), or join our [Discord community](https://pscale.link/community) to see how others are using PlanetScale.
