Created
September 26, 2019 10:42
-
-
Save valeriocos/c5dd78b4e06cd73477e1873455f4f585 to your computer and use it in GitHub Desktop.
[crossminer] Upload Elasticsearch indexes (remember to create the BACKUP_FOLDER, you need to install elasticdump)
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 | |
BACKUP_FOLDER=backup | |
ELASTICSEARCH=https://admin:admin@localhost:9200 | |
echo "scava-conf-smells" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-conf-smells.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-conf-smells \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-conf-smells.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-conf-smells \ | |
--limit=100 \ | |
--type=data | |
echo "scava-project-relations" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-project-relations.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-project-relations \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-project-relations.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-project-relations \ | |
--limit=100 \ | |
--type=data | |
echo "scava-topics" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-topics.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-topics \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-topics.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-topics \ | |
--limit=100 \ | |
--type=data | |
echo "scava-conf-deps" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-conf-deps.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-conf-deps \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-conf-deps.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-conf-deps \ | |
--limit=100 \ | |
--type=data | |
echo "scava-metrics" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-metrics.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-metrics \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-metrics.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-metrics \ | |
--limit=100 \ | |
--type=data | |
echo "scava-users" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-users.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-users \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-users.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-users \ | |
--limit=100 \ | |
--type=data | |
echo "scava-dev-deps" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-dev-deps.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-dev-deps \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-dev-deps.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-dev-deps \ | |
--limit=100 \ | |
--type=data | |
echo "scava-dev-versions" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-dep-versions.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-dep-versions \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-dep-versions.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-dep-versions \ | |
--limit=100 \ | |
--type=data | |
echo "scava-factoids" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-factoids.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-factoids \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/scava-factoids.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=scava-factoids \ | |
--limit=100 \ | |
--type=data | |
echo ".kibana" | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/kibana.mapping.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=.kibana \ | |
--limit=100 \ | |
--type=mapping | |
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \ | |
--input=$BACKUP_FOLDER/kibana.json \ | |
--output=$ELASTICSEARCH \ | |
--output-index=.kibana \ | |
--limit=100 \ | |
--type=data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment