Open skycult opened 4 years ago
Hello, there is an option to backup/restore all databases? Thank you!
Did you find anything till now. How to take all Databases at once
I created a nodejs small cli app to get a full databases list calling the script for every list item.
@skycult could you please share your app? I have plenty of DBs to backup so not inventing wheel once again would be quite time-saving)
Just curl couchdb, parse it with jq, and pass the list into a for loop? :)
Its a simple curl, please find the snippet in BASH below:
for i in $(curl -X GET http://127.0.0.1:5984/_all_dbs); do \
i=${i//[/}; i=${i//]/}; i=${i//\"/}
IFS=, read -ra dbname <<< "$i"
done
for db in "${dbname[@]}"; do \
echo $db;
done
Shouldn't that line be
for db in "${dbname[@]}"; do \
Shouldn't that line be
for db in "${dbname[@]}"; do \
Yes, it was a typo, updated. Thanks for pointing it out.
Thanks for sharing the snippet
Also thanks, I adapted it to extract all the databases into a directory:
for i in $(curl -X GET http://127.0.0.1:5984/_all_dbs); do \
i=${i//[/}; i=${i//]/}; i=${i//\"/}
IFS=, read -ra dbname <<< "$i"
done
for db in "${dbname[@]}"; do \
echo $db;
./couchdb-dump.sh -b -H 127.0.0.1 -d ${db} -f dbs/${db}.json
done
Hello, there is an option to backup/restore all databases? Thank you!