Restore Database
This page explains how to restore the Appsmith internal database backup using the appsmithctl
utility.
Prerequisites
Before starting, ensure the following:
- You need a self-hosted Appsmith instance up and running. If you haven’t 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 restore tasks.
- Access to execute
docker-compose
orkubectl
commands, depending on your deployment setup. - Verify that the backup archive file you want to restore is available.
Restore database backup
Follow the appropriate instructions based on your deployment environment:
- Docker
- Kubernetes
Follow these steps to restore Appsmith database backup for Docker-based installations:
-
Copy the backup file into the container:
docker cp ./appsmith-data.archive appsmith:/appsmith-stacks/data/restore/
-
Import the backup data:
docker-compose exec -it appsmith appsmithctl import_db
-
Copy the
docker.env
file and add the path for thedocker.env
file if not present in the installation folder.docker cp ./docker.env appsmith:/appsmith-stacks/configuration/
-
Restart the Appsmith server to apply changes:
docker-compose exec -it appsmith supervisorctl restart backend
Follow these steps to restore Appsmith database backup for Kubernetes installations:
-
Retrieve the name of the Appsmith pod:
kubectl get pods
-
Copy the backup file into the pod. Replace
ANY_APPSMITH_POD_NAME
with the pod name:kubectl cp ./appsmith-data.archive ANY_APPSMITH_POD_NAME:/appsmith-stacks/data/restore/
-
Navigate to the
/appsmith-stacks/configuration/
folder and update thedocker.env
file with the following parameters:# The values generated and stored during the backup process
APPSMITH_ENCRYPTION_PASSWORD=APPSMITH_ENCRYPTION_PASSWORD
APPSMITH_ENCRYPTION_SALT=APPSMITH_ENCRYPTION_SALT -
Import the backup data. Replace
ANY_APPSMITH_POD_NAME
with the pod name:kubectl exec -it ANY_APPSMITH_POD_NAME -- appsmithctl import_db
-
Restart the Appsmith pods based on your setup:
-
If autoscaling is turned on:
kubectl rollout restart deployment appsmith
-
If autoscaling is turned off, or you’re using the Community Edition:
kubectl rollout restart statefulset appsmith
-
Troubleshooting
If you encounter any issues during the restore process, consider the following:
- Ensure you've copied the backup archive to the correct folder within the container or pod.
- Verify that you have the required permissions to execute
docker-compose
orkubectl
commands. - If restarting the pods fails, check the logs for errors. For more information, see Get Container logs guide.
If you continue to face issues, contact support using the chat widget available in the bottom-right corner of this page.