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

# Managing Databases

# Overview

Aptible makes database management effortless by fully managing and monitoring your Aptible Databases 24/7. From scaling to backups, Aptible automatically ensures that your Databases are secure, optimized, and always available. Aptible handles the heavy lifting and provides additional controls and options, giving you the flexibility to manage aspects of your Databases when needed.

# Learn More

<AccordionGroup>
  <Accordion title="Scaling Databases">
    RAM/CPU, Disk, IOPS, and throughput can be scaled on-demand with minimal downtime (typically less than 1 minute) at any time via the Aptible Dashboard, CLI, or Terraform provider.

    Refer to [Database Scaling ](/core-concepts/scaling/database-scaling)for more information.
  </Accordion>

  <Accordion title="Upgrading Databases">
    Aptible supports various methods for upgrading Databases, such as dump and restore, logical replication, and in-place upgrades.

    Refer to [Database Upgrades](/core-concepts/managed-databases/managing-databases/database-upgrade-methods) for more information.
  </Accordion>

  <Accordion title="Backing up Databases">
    Aptible performs automatic daily backups of your databases every 24 hours. The default retention policy optimized for production environments, but this policy is fully customizable at the environment level, allowing you to configure daily, monthly, and yearly backups based on your requirements.

    In addition to automatic backups, you have the option to enable cross-region backups for disaster recovery and retain final backups of deprovisioned databases. Manual backups can be initiated at any time to provide additional flexibility and control over your data.

    Refer to [Database Backups](/core-concepts/managed-databases/managing-databases/database-backups) for more information.
  </Accordion>

  <Accordion title="Replicating Databases">
    Aptible simplifies Database replication (PostgreSQL, MySQL, Redis) and clustering (MongoDB) databases in high-availability setups by automatically deploying the Database Containers across different Availability Zones (AZ).

    Refer to [Database Replication and Clustering](/core-concepts/managed-databases/managing-databases/replication-clustering) for more information.
  </Accordion>

  <Accordion title="Encrypting Databases">
    Aptible has built-in Database Encryption that applies to all Databases, as well as the option to configure additional [Custom Database Encryption](/core-concepts/managed-databases/managing-databases/database-encryption/custom-database-encryption). [Application-Level Encryption](/core-concepts/managed-databases/managing-databases/database-encryption/application-level-encryption) may also be used.

    Refer to [Database Encryption](/core-concepts/managed-databases/managing-databases/database-encryption/overview) for more information.
  </Accordion>

  <Accordion title="Restarting Databases">
    Databases can be restarted in the following ways:

    * Using the [`aptible db:restart`](/reference/aptible-cli/cli-commands/cli-db-restart) command if you are also resizing the Database
    * Using the [`aptible db:reload`](/reference/aptible-cli/cli-commands/cli-db-reload) command if you are not resizing the Database
      * Note: this command is faster to execute than `aptible db:restart`
    * Within the Aptible Dashboard, by:
      * Navigating to the database
      * Selecting the **Settings** tab
      * Selecting **Restart**
  </Accordion>

  <Accordion title="Renaming Databases">
    A Database can be renamed in the following ways:

    * Using the [`aptible db:rename`](/reference/aptible-cli/cli-commands/cli-db-rename) command
    * Using the Aptible [Terraform Provider](https://registry.terraform.io/providers/aptible/aptible/latest/docs)

    For the change to take effect, the Database must be restarted.

    <Warning>Database handles cannot start with "internal-" or "sg-" because databases with these prefixes cannot have [Database Endpoints](/core-concepts/managed-databases/connecting-databases/database-endpoints) allocated due to AWS limitations.</Warning>
  </Accordion>

  <Accordion title="Deprovisioning Databases">
    A Database can be deprovisioned in the following ways:

    * Using the [`aptible db:deprovision`](/reference/aptible-cli/cli-commands/cli-db-deprovision) command
    * Using the Aptible [Terraform Provider](https://registry.terraform.io/providers/aptible/aptible/latest/docs)

    When a Database is deprovisioned, its [Database Backups](/core-concepts/managed-databases/managing-databases/database-backups) are automatically deleted per the Environment's [Backup Retention Policy.](/core-concepts/managed-databases/managing-databases/database-backups#backup-retention-policy-for-automated-backups)
  </Accordion>

  <Accordion title="Restoring Databases">
    A deprovisioned Database can be [restored from a Backup](/core-concepts/managed-databases/managing-databases/database-backups#restoring-from-a-backup) as a new Database. The resulting Database will have the same data, username, and password as the original when the Backup was taken. Any [Database Endpoints](/core-concepts/managed-databases/connecting-databases/database-endpoints) or [Replicas](/core-concepts/managed-databases/managing-databases/replication-clustering) will have to be recreated.
  </Accordion>
</AccordionGroup>
