To ensure a smooth transition from an embedded Solr instance to a standalone one while maintaining data and configuration integrity, follow the steps outlined below:
Download Solr and unzip it parrel to ofbiz-framework
/ ├── ofbiz-framework/ └── solr-8.11.3/
Stop Solr
If Solr standalone is running, need to stop../home/solr8.11.3/bin/solr stop
Stop OFBiz
Before starting, stop the embedded Solr instance to prevent data corruption and file lock issues.cd /home/ofbiz-framework/ ./gradlew terminateOfbiz
Copy Core Configuration
Navigate to
${ofbiz.home}/plugins/solr/home/{YourCoreName}
and copy the core configuration.Paste it into your standalone Solr instance at
solr8.11.3/server/solr/{YourCoreName}
.
From ofbiz-framework/# Make sure that the {YourCoreName} directory exists in Solr mkdir -p /home/solr8.11.3/server/solr/{YourCoreName}/data/ cp -r plugins/solr/home/{YourCoreName}/* /home/solr8.11.3/server/solr/{YourCoreName}/
Copy Data
Locate the
<dataDir>
tag insolrconfig.xml
to identify the existing data directory. By default, it is${ofbiz.home}/runtime/indexes/solr/products/
.Copy the contents of the data directory and paste them into
solr8.11.3/server/solr/{YourCoreName}/data/
.
From ofbiz-framework/# Make sure the target data directory exists mkdir -p /home/solr8.11.3/server/solr/{YourCoreName}/data/ # Copy the index data from OFBiz to your standalone Solr core's data directory cp -r runtime/indexes/solr/products/* /home/solr8.11.3/server/solr/{YourCoreName}/data/
Update Data Directory
Modify
solr8.11.3/server/solr/{YourCoreName}/conf/solrconfig.xml
to set the appropriate data directory path.To use Solr’s default path, set the following:
<dataDir>${solr.data.dir:}</dataDir>
If you have copied the core data to a custom path, update the path accordingly.
From ofbiz-framework/ run -sed -i 's|<dataDir>.*</dataDir>|<dataDir>${solr.data.dir:}</dataDir>|' /home/solr8.11.3/server/solr/{YourCoreName}/conf/solrconfig.xml grep "<dataDir>" /home/solr8.11.3/server/solr/{YourCoreName}/conf/solrconfig.xml
Start Solr
cd /home/solr8.11.3bin/solr start