Documentation for backup and importing complete instance - Docker
Is your feature request related to a problem? Please describe. There is no documentation on how to backup and importing the complete database. For people like me with limited experience experience with databases, this would be priceless when doing backups and migrations.
There seems to be a page in the documentation mentioning backup, but it's left empty: https://help.teable.io/deployment/migrating-from-docker-standalone-to-teable-enterprise#id-1.-backup-your-data
Describe the solution you'd like
- Step-by-step instructions on how to backup the complete teable instance when self-hosting with Docker.
- Step-by-step instructions on how to import the data to a new instance/machine.
Or even better, a ready-made export/import script.
Describe alternatives you've considered At the moment, I backup the complete volumes and zip them up for backups. I don't think this is the most optimal way to do it - please correct me if I am wrong.
Additional context
The reason for me creating this issue, is that I tried to add redis cache to my current docker-compose.yml.
I first copied the entire folder with docker-compose.yml, .env, volume folders to another folder and added redis cache to docker-compose.yml.
When I ran docker compose up -d and tried to visit the teable instance in the browser, the database was wiped clean, which I couldn't debug (I lack the technical skills at the moment). Other than this, the instance seemed to work fine.
Guide from docker how to backup volumes: https://docs.docker.com/engine/storage/volumes/#back-up-restore-or-migrate-data-volumes
LLM answer
Replace placeholders with values from your .env file or Docker setup.
Backup
- Identify the PostgreSQL container:
docker ps - Create a backup:
docker exec -t <postgres_container_name> pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > backup.sql
Restore
- Stop the Teable app:
docker compose down - Restore the backup:
cat backup.sql | docker exec -i <postgres_container_name> psql -U ${POSTGRES_USER} ${POSTGRES_DB} - Restart Teable:
docker compose up -d
It would be ideal to be able to restore containers and volumes or whatever is necessary to be able to migrate an existing teable.io installation.
You can export data from teable.io to CSV and import them to your local instance.
You can export data from teable.io to CSV and import them to your local instance.
I have found the CSV import slightly unreliable if the data has special characters. I think it messes up if a field has a comma in it.
psql -U ${POSTGRES_USER} ${POSTGRES_DB}
Hello, what is the username and db name? how to find this info? Thank you