Skip Navigation
Show nav
Heroku Dev Center Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
Heroku Dev Center Dev Center
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log in or Sign up
View categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
    • Buildpacks
  • Developer Tools
    • AI Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
        • Working with Rails
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Inference Essentials
    • Inference API
    • Inference Quick Start Guides
    • AI Models
    • Tool Use
    • AI Integrations
    • Vector Database
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
    • Heroku AppLink
      • Working with Heroku AppLink
      • Heroku AppLink Reference
      • Getting Started with Heroku AppLink
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Other Salesforce Integrations
  • Databases & Data Management
  • Data Maintenance CLI Commands

Data Maintenance CLI Commands

English — 日本語に切り替える

Table of Contents [expand]

  • Commands

Last updated March 18, 2026

On March 18, 2026, we added the commands from the Data Maintenance CLI plugin into the Heroku CLI. These commands include and expand on the functionality of the pg:maintenance, pg:maintenance:run, pg:maintenance:window, and redis:maintenance commands, which are no longer available.

The data:maintenances CLI commands help you manage planned maintenance for Heroku Data add-ons. Using these maintenance-related commands is optional. Heroku schedules and performs maintenance on Heroku Data add-ons automatically without any intervention.

Heroku performs maintenance for Essential Heroku Postgres databases and Mini Heroku Key-Value Store instances as needed and without notice. The following commands are only relevant for add-ons on Standard, Premium, Private, and Shield plans for Heroku Postgres and Premium, Private, and Shield plans for Heroku Key-Value Store.

If you want more control over the maintenance process, use these commands to control when and how planned maintenance occurs. For Heroku Postgres and Heroku Key-Value Store, use these commands to:

  • Review maintenance windows
  • Change maintenance windows
  • Schedule to run a maintenance event
  • Reschedule an existing maintenance event
  • Trigger a maintenance event
  • View details of a planned maintenance event
  • Review history of planned maintenance events
  • Wait for a triggered maintenance event to complete
  • Test maintenance impact on a staging app

For more info on the maintenance process, see Heroku Key-Value Store Maintenance and Heroku Postgres Maintenance.

Data Maintenance Commands and Apache Kafka for Heroku

For Apache Kafka for Heroku, the commands provide limited support for viewing details about in-progress and historical maintenance on your clusters. Only the data:maintenances:info and data:maintenances:history commands are available for your Kafka add-ons. See the Apache Kafka on Heroku Maintenance FAQ for more information.

Commands

heroku data:maintenances

The heroku data:maintenances command lists the most recent maintenance event for each Heroku Data add-on for an app. This event is either pending maintenance if one exists, or the most recent completed maintenance event. pending maintenance events include a required by and a scheduled for timestamp.

$ heroku data:maintenances -a example-app

Fetching maintenances... done
Addon                    Attachments     Scheduling Window                    Status    Required by  Scheduled for
 ────────────────────── ───────────────── ─────────────────────────────────── ───────── ────────────── ───────────────────
redis-spherical-12345   REDIS_URL        Thursdays 20:30 to Fridays 00:30 UTC  completed  -            -
postgresql-cubed-56789  DATABASE_URL     Tuesdays 19:00 to 23:00 UTC           completed  -            -

heroku data:maintenances:info

The heroku data:maintenances:info command displays details of the most recent maintenance event for a single Heroku Data add-on. This event is either pending maintenance if one exists, or the most recent completed maintenance event. pending maintenance events include a required by and a scheduled for timestamp.

$ heroku data:maintenances:info DATABASE -a example-app

Fetching maintenance... done
addon_attachments: DATABASE_URL
addon_description: Standard Non-HA
addon_kind:        heroku-postgresql
addon_name:        postgresql-octagonal-1234
addon_plan:        standard-4
addon_window:      Tuesdays 14:30 to 18:30 UTC
app_name:          example-app
method:            changeover
reason:            routine_maintenance
required_by:       2026-01-31 21:00:00 +0000
scheduled_for:     2026-01-27 14:30:00 +0000
server_created_at: 2025-10-29 11:05:24 +0000
status:            preparing
window:            Tuesdays 14:30 to 18:30 UTC

heroku data:maintenances:window

The heroku data:maintenances:window command displays the configured maintenance window for a single Heroku Data add-on. The maintenance window is the day of the week and hours of the day in UTC when a maintenance event automatically triggers. You can change this value with the data:maintenances:window:update command. You can also trigger maintenance before the scheduled time using the data:maintenances:run command.

$ heroku data:maintenances:window DATABASE -a example-app

Fetching maintenance window for DATABASE... done
window:            Tuesdays 14:30 to 18:30 UTC

heroku data:maintenances:window:update

The heroku data:maintenances:window:update command changes the configured maintenance window for a single Heroku Data add-on.

If there’s a pending maintenance event scheduled for the add-on, changing the maintenance window changes the scheduled for maintenance time for that add-on.

 

The maintenance window arguments are in UTC. For example, if you want your maintenance event to run on Monday at 10:00 AM US Pacific time, set your window to “Monday 18:00”.

$ heroku data:maintenances:window:update DATABASE Sunday 14:30 -a example-app

Setting maintenance window for postgresql-octagonal-1234 to Sunday 14:30... done
previous_window:          Tuesdays 14:30 to 18:30 UTC
window:                   Sundays 14:30 to 18:30 UTC

heroku data:maintenances:wait

If a pending maintenance is triggered, the heroku data:maintenances:wait command blocks it until the maintenance event completes.

$ heroku data:maintenances:wait DATABASE -a example-app

Waiting for maintenace on DATABASE to complete... maintenance completed

heroku data:maintenances:schedule

The heroku data:maintenances:schedule command creates a new pending maintenance event, or updates the scheduled for maintenance time for an existing pending maintenance event. The scheduled for maintenance time is always within a configured maintenance window.

$ heroku data:maintenances:schedule DATABASE -a example-app --weeks 2

Scheduling maintenance for DATABASE... maintenance scheduled
Maintenance for DATABASE scheduled for 2026-03-26 19:00:00 +0000

You can only reschedule the maintenance time within the configured window. You can’t reschedule outside of the deadline or before the current date.

note When using --weeks, a positive number delays the scheduled maintenance time by the specified number of weeks. A negative number advances the scheduled maintenance time by the specified number of weeks. For example, --weeks 3 postpones the scheduled maintenance time for 3 weeks,]. --weeks -2 moves up the scheduled maintenance time by 2 weeks.

heroku data:maintenances:run

The heroku data:maintenances:run command triggers a pending maintenance event for a single Heroku Data add-on.

$ heroku data:maintenances:run DATABASE -a example-app -c example-app

Triggering maintenance... maintenance triggered

heroku data:maintenances:history

The heroku data:maintenances:history command displays details about the most recent maintenance events for a single Heroku Data add-on.

$ heroku data:maintenances:history DATABASE -a example-app

Fetching maintenance history for DATABASE... done
 Scheduled For             Started At                Completed At              Duration (seconds) Reason              Status    Window
 ───────────────────────── ───────────────────────── ───────────────────────── ────────────────── ─────────────────── ───────── ──────────────────────────
 2026-02-17 20:00:00 +0000 2025-11-17 20:01:15 +0000 2025-11-17 20:03:31 +0000 136                routine_maintenance completed Mondays 20:00 to Tuesdays…
 2026-02-11 22:09:42 +0000 2025-08-11 22:09:43 +0000 2025-08-11 22:09:56 +0000 12                 customer_request    completed Mondays 20:00 to Tuesdays…
 2026-01-28 20:00:00 +0000 2025-07-28 20:00:21 +0000 2025-07-28 20:03:07 +0000 166                routine_maintenance completed Mondays 20:00 to Tuesdays…

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2026 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices