This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clickhouse-client --query="SELECT * FROM table FORMAT Native" > table.native | |
| Native is the most efficient format | |
| CSV, TabSeparated, JSONEachRow are more portable: you may import/export data to another DBMS. | |
| Dump of metadata: | |
| clickhouse-client --query="SHOW CREATE TABLE table" --format=TabSeparatedRaw > table.sql | |
| Restore of metadata: | |
| clickhouse-client < table.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copy database from one server to another server | |
| mongodump --host <from_host> --db <from_db> --archive | mongorestore --host <to_host> --archive | |
| # Restore database(or collection) to another database(or collection) | |
| mongorestore --gzip --archive=${BACKUP_FILE_GZ} --nsFrom "${DB_NAME}.*" --nsTo "${DB_NAME_RESTORE}.*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| echo "🧹 Remove old Docker (if exists)..." | |
| sudo apt-get remove -y docker docker-engine docker.io containerd runc || true | |
| echo "📦 Install dependencies..." |