You need to move from one solr instance to another and can't be bothered with mismatching versions or whatever? These two scripts will help you :)
First you need to create a new core in the target instance. You may want to use the schema/configset from the originating instance though, as the default schema might not be ideal.
Im my scenario I moved from Solr 5.5.5 to Solr 7.4.
Therefore I had to (at least) update the solrconfig.xml
, where the lucene version is specified.
The exact version you need can be found in the default configset ([solr_root]/server/solr/configsets/...
)
The first script downloads and entire core into one file (one json document per line).
python download.py 172.0.0.1 8983 my_core my_core.json
The second one uploads it to a server.
python uploadSolr.py 172.0.0.1 8983 my_core my_core.json
IMPORTANT
The download script is extremely stupid. Once it's done, it will continue requesting the server. Fortunately tqdm will give you a rough estimate for how long it may take to finish, so you know how long your coffe break can be. There will be no harm if it runs for a while (except heating up your server). Once the progress bar is full, kill the script with Ctrl+C.
FYI: Downloading 2.5G (380k docs) took 5 minutes, uploading them again took just over an hour.
Requirements to install:
- pysolr
- requests
- tqdm
You could remove tqdm from the code. It's for a nice progress bar. requests could also be removed, but I'm to lazy to update the download scrip to also use pysolr (or vice versa).
Hi @karcool ,
it might help to print the contents of
res
and go from there. The cursorMark is essential for paginating through the entire query set and should work. I'm using this in Solr 9.3 without problems and I can't imagine something changed in 9.4 (assuming you are running the latest Solr version). Ifres
does not yield a helpful error message, you may have a look at the solr logs, check response headers, and study the changelog (I couldn't find anything related past version 8.x).Good luck!