Migration of solr cores after solr version upgradation from 4.10.4 to 6.6.0 on Cent os 7

走远了吗. 提交于 2019-12-10 12:17:16

问题


I have upgraded apache solr from 4.10.4 to 6.6.0 on Cent os 7 server, with the help of Upgrade Apache Solr from 4.10.4 to 6.6.0 on Cent os 7

I have taken backup of old solr core namely sample_core in /home/user/old_solr/sample_core folder

How can I migrate my old solr(4.10.4) data in new solr version (6.6.0)


回答1:


Make sure solr is running

sudo service solr status

Create new solr core by name sample_core

use solr user sudo su solr

Create sample_core /opt/solr-6.6.0/bin/solr create -c sample_core

If you are not able to create a new core due to existing broken core, remove broken cores

/opt/solr-6.6.0/bin/solr delete -c <core_name>
/opt/solr-6.6.0/bin/solr delete -c sample_core

delete data folders from /var/solr/data/< core_name > folder (If exists)

exit solr user and use superuser by command exit

use root user by command sudo su

rm -r -f /var/solr/data/sample_core

copy existing solr schema.xml and solrconfig.xml to newly created core

use superuser sudo su

sudo cp -r /home/user/old_solr/sample_core/conf/schema.xml /var/solr/data/sample_core/conf
sudo cp -r /home/user/old_solr/sample_core/conf/solrconfig.xml /var/solr/data/sample_core/conf

make solr as owner to moved files

sudo chown -R solr:solr /var/solr/data/sample_core/conf/schema.xml
sudo chown -R solr:solr /var/solr/data/sample_core/conf/solrconfig.xml

restart solr server

sudo service solr restart

Reindex solr data

Now you are ready to reindex solr data, reindexing solr data after upgrading solr version will give best performance without any unknown issues.

Incase if you want to use old data without reindex

I have not tried this practically while migration

copy sample_core data from backup to solr 6.6 data

sudo cp -r /home/user/old_solr/sample_core/data /var/solr/data/sample_core

change owner to solr

sudo chown -R solr:solr /var/solr/data/sample_core/data


来源:https://stackoverflow.com/questions/44760114/migration-of-solr-cores-after-solr-version-upgradation-from-4-10-4-to-6-6-0-on-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!