Skip to main content

Backup Database

When you create a backup of your Appsmith instance, it includes the database, configuration, and Git data. To back up your entire Appsmith instance, refer to the Backup Instance guide. You may also choose to back up only the Appsmith data. This page explains how to back up Appsmith data specifically for your self-hosted Appsmith instance using the appsmithctl utility.

Prerequisites

Before starting, ensure the following:

  • Your self-hosted Appsmith instance is running. If you haven’t already installed Appsmith, refer to the Installation guides. This guide assumes you are working with an existing installation.
  • Ensure you have at least 2 GB of free storage available to perform backup tasks.
  • Ensure you have the appropriate access to execute docker-compose or kubectl commands, depending on your deployment setup.

Create database backup

Follow these steps to back up your Appsmith internal database:

  1. Go to the directory that has the docker-compose.yml file.

  2. Get your encryption details with:

    docker-compose exec -it appsmith cat /appsmith-stacks/configuration/docker.env | grep ENCRYPTION

    Store the encryption details securely, as you need them for restoring the Appsmith database.

  3. Create a backup archive with:

    docker-compose exec -it appsmith appsmithctl export_db
    • Ensure that the name of the backup archive (appsmith-data.archive) isn't changed.
    • The backup archive file is stored in the /appsmith-stacks/data/backup/ folder in your container directory. You can access it at ./stacks/data/backup/ on your local machine.
  4. If you can't access or have a different volume configuration, copy the archive file to your host disk with:

    docker cp appsmith:/appsmith-stacks/data/backup/appsmith-data.archive .

    This command copies the backup archive into your current directory.

  5. To recreate the same environment elsewhere, copy the docker.env file with:

    docker cp appsmith:/appsmith-stacks/configuration/docker.env .

    This command copies the docker.env file into your current directory.

Troubleshooting

If you encounter any issues during the restore process, consider the following:

  • Verify that you have the required permissions to execute docker-compose or kubectl commands.

If you continue to face issues, contact support using the chat widget available in the bottom-right corner of this page.