You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: discovery-data/latest/all-backup-restore.sh
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,8 @@ Basically, you don't need these advanced options.
42
42
--datastore-archive-option="<tar_option>" Tar options for compression used on archiving the backup files of ElasticSearch, MinIO and internal configuration. Default "-z".
43
43
--postgresql-archive-option="<tar_option>" Tar options for compression used on archiving the backup files of postgres. Note that the backup files of postgresql are archived on its pod by default. Default "-z".
44
44
--etcd-archive-option="<tar_option>" Tar options used on archiving the backup files of etcd. Note that the backup files of etcd are archived on its pod by default. Default "-z".
45
+
--reindex-old-index Reindex elastic search indices from version 6 to 7 before making the backup. If existing elastic search indices version is already 7, this flag does nothing. They have to be reindexed if you want to restore to 4.8.x. Reindex actually won't change your data, but it takes time. If you want to make the backup without reindex, use '--ignore-old-index' instead.
46
+
--ignore-old-index Whether to skip reindexing old (version 6) elastic search indices before making the backup. You can proceed backup without reindex, but you can't restore the backup data to 4.8.x.
45
47
--skip-verify-archive Skip the all verifying process of the archive.
46
48
--skip-verify-backup Skip verifying the backup file.
47
49
--skip-verify-datastore-archive Skip verifying the archive of datastores.
elifecho"$result"| grep -q "ElasticSearch has no index";then
1182
+
echo"NoIndex"
1183
+
else
1184
+
echo"Unknown"
1185
+
fi
1186
+
}
1187
+
1188
+
validate_elastic_version() {
1189
+
ELASTIC_VERSION="${1:-$(get_elastic_version)}"
1190
+
1191
+
if [[ ${ELASTIC_VERSION}="ES6" ]];then
1192
+
brlog "WARN""Elasticsearch 6 detected."
1193
+
if [[ ${IGNORE_OLD_INDEX}="true" ]];then
1194
+
brlog "WARN""Ignoring old index."
1195
+
elif [[ ${REINDEX_OLD_INDEX}="true" ]];then
1196
+
brlog "INFO""Elasticsearch 6 will be reindexed after quiescing."
1197
+
else
1198
+
brlog "ERROR""Detected old index created in ElasticSearch 6 that is not supported Watson Discovery 4.8.x. They have to be reindexed if you restore to 4.8.x or higher. Reindex actually won't change your data, but it takes time. Run backup script with '--reindex-old-index' option if you reindex them. You can proceed backup without reindex, but you can't restore the backup data to 4.8.x. If you would like to ignore the error, run backup script with '--ignore-old-index' option."
1199
+
exit 1
1200
+
fi
1201
+
fi
1202
+
}
1203
+
1204
+
# Reindex elastic search indices from version 6 to 7.
trap_remove "brlog 'INFO' 'You currently oc login as a scripts ServiceAccount. You can rerun scripts with this. Please delete ServiceAccount ${service_account} and clusterrolebinding ${service_account}-cluster-rb when you complete backup or restore'"
1455
1537
trap_remove "brlog 'INFO' 'brlog 'INFO' 'Please delete rolebinding ${service_account}-rb when you delete ServiceAccount'"
1456
1538
brlog "INFO""Deleted scripts service account: ${service_account}"
0 commit comments