Cent os 7 上 solr 版本从 4.10.4 升级到 6.6.0 后 solr 核心的迁移

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

我已经在 Cent os 7 服务器上将 apache solr 从 4.10.4 升级到 6.6.0, 在...的帮助下

我已经在 /home/user/old_solr/sample_core 文件夹

中备份了旧的 solr 核心,即 sample_core

如何将旧的 solr(4.10.4) 数据迁移到新的 solr 版本 (6.6.0)

确保solr是运行

sudo service solr status

按名称创建新的 solr 核心 sample_core

使用solr用户 sudo su solr

创建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

将现有的solr schema.xml和solrconfig.xml复制到新创建的核心

使用超级用户 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

solr 成为移动文件的所有者

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

重启solr服务器

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.

如果你想在没有重新索引的情况下使用旧数据

I have not tried this practically while migration

从备份中复制sample_core数据到solr 6.6数据

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

将所有者更改为 solr

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