[Question] Restore PostgreSQL and Cassandra backups into Docker tb-cassandra
See original GitHub issueHi,
I’ve have a question about how to restore PostgreSQL and Cassandra backups into a docker container created with the image tb-cassandra
. Basically I had a previous installation of Thingsboard + PostgreSQL + Cassandra into file system. Now I have a docker container which works good, I need to import all backups (.sql
file from postgre and the .tar from cassandra), has anyone some advice to do that?
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Cassandra backup and recovery | Apigee X - Google Cloud
Restoration takes your data from the backup location and restores the data into a new Cassandra cluster with the same number of nodes....
Read more >How to backup the cassandra running in docker container
just mount cassandra docker volume in host somewhere and take backup as usual with Snapshotter . you can mount docker Cassandra directory /var/ ......
Read more >Running Cassandra and PostgreSQL in Docker
In this post I describe how to set up the environment using Docker containers for Cassandra and Postgres so that you don't have...
Read more >Newest 'restore' Questions
I'm trying to restore a database backup that is on a server. This server is on a remote machine and runs in a...
Read more >Backing up your Postgres Database | by Gary Sieling - Medium
For a running system, you must use a backup method that handles database transactions. Postgres supports two options — you can choose to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Haven’t tried it, but theoretically it should work to:
/var/lib/postgresql/11/data
or/var/lib/postgresql/12/data
(your local postgresql installation) to${NEW_FOLDER}/db
cassandra
folder of your local Cassandra installation to${NEW_FOLDER}/cassandra
(check if it contains subfolders like data, commitlog…).firstlaunch
and.upgradeversion
files, last one containing the version of your current Thingsboard Docker installation (i.e. 3.3.1) inside of${NEW_FOLDER}
${NEW_FOLDER}
(see here)docker-compose.yml
file, defining${NEW_FOLDER}:/data
undervolumes
That should work, but I haven’t tried (maybe doing it tomorrow). Backup your data before trying. As you see, I wouldn’t do it by using your backup files as Thingsboard uses the whole database installation folders.
@fgnm Hello, We are using the docker exec command for PostgreSQL, and sstableloader for Cassandra e.g. restore for PostgreSQL:
docker exec -i container_name psql --username postgres -d db_name </path/on/your/machine/dump.sql
and for Cassandra:sudo sstableloader --verbose --nodes 127.0.0.1 ./thingsboard/ts_kv_latest_cf
Also, you can explore our scripts by the path: https://github.com/thingsboard/ThingsboardSupport/tree/main/databases