I am currently running a cloud SOLR6 service in Kubernetes 3 Zookeeper servers and 6 nodes
I recently deployed a new cloud SOLR6 service for dev purposes, but it requires the same schema structures as the current running environment, the data isn't important as I will repopulate that manually
How can i replicate only the structure/schema of the collections running in the current setup
This is how ended up doing this, I am sure there is a more efficient way to do it , but this worked.
Log into the source solr pod
kubectl -it exec {{ sourcePodName }} -c {{ containerName }} bash
eg: kubectl -it exec solr-staging-0 -c solr bash
Create a dump of the configSet
/opt/solr/bin/solr zk -n {{ configSetName }} -d /tmp/{{ configSetName }}/ -z {{ sourceZookeeperAddress }}:{{ zookeeperPort }}
eg: /opt/solr/bin/solr zk -n connectors -d /tmp/connectors/ -z solr-dev.solr-staging-cluster:2181
Retrieve the dump from the kubernetes pod by copying it to your local
kubectl cp {{ sourcePodName }}:/tmp/{{ configSetName }}/* /tmp/{{ configSetName }}
eg: kubectl cp solr-staging-0:/tmp/connectors/* /tmp/connectors
Create a zip file of the conf content
zip -r /tmp/{{ configSetName }}/con/conf/* /tmp/{{ configSetName }}.zip
eg: zip -r /tmp/connectors/con/conf/* /tmp/connectors.zip
Port forward to your destination kubernetes server
gcloud container clusters get-credentials {{ clusterName }} --zone {{ zone }} --project {{ projectName }} && kubectl port-forward {{ podName }} 8983:8983
eg: gcloud container clusters get-credentials workflows --zone europe-west1-d --project bidvest-alice && kubectl port-forward solr-dev-0 8983:8983
Import your dataset on your destination solr cluster
NOTE: This is actually the SOLR 7.7 import statement, but the SOLR6.6 command didn't work
curl -X POST --header "Content-Type:application/octet-stream" --data-binary @/tmp/{{ configSetName }}.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name={{ configSetName }}"
eg: cmd: curl -X POST --header "Content-Type:application/octet-stream" --data-binary @/tmp/connectors.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=connectors"