0

PROBLEM

We are preparing to deploy considerable changes to an existing Sitecore site with reasonably high traffic; new renderings, new page templates, new content etc. During the deployment process we are concerned about the amount of time it will take after deployment for all Lucene indexes to rebuild and include all the new content (it could cause a lot of issues in the short term because lots of the components use the indexes including navigation components). We're also concerned about when in our deployment process the index rebuild should begin e.g. while the first delivery server is out of the load balancer.

QUESTION

Could we create a pre-prod environment with all the CMS changes deployed over the existing PROD database, re-build all indexes here, then take a copy of the 'Data\indexes' folder and use this as part of our deployment? Is there any reason why this wouldn't work?

2

Technically this is possible. You can copy the index files from the CM server and deploy that out to the CD servers.

But, there are concerns with doing that. I am making the assumption that you have this question because you want to have a zero downtime deployment:

  • The CD servers will still want to re-index as part of any publish operation, so you may need to stop index operations during the deployment and enable once the deployment is complete.
  • You have the potential to be in a situation where an item is present in the index, but it is not in the web database yet. If this is the case, depending on your code, you may create a link that will 404, or worse cause a run-time error.

Other options:

I would look at approaching this differently. The first and best option, would be to move your site over to Solr. This means that all CD's use the same index, it can be rebuilt during the CM deployment and then once the CDs are deployed and moved over to the Solr index, it will all be setup. Solr will give you many other benefits too, such as all CD's being sync'd, CD servers no longer have to build and maintain their own index etc... (There are more benefits to Solr that you can look up)

But, the move to Solr would be a big project, so if you must stick with Lucene, I would recommend this workflow:

  • Setup a new Web database (as you would have in a green/blue deployment)
  • Deploy to the CM and update the connection string for the web database to the new db
  • Publish to the new web db
  • Take the CD's off line one at a time so that the Site does not go down at all
    • Deploy to the CD that is off line
    • Rebuild the local index, do this on the CD server, you may need to enable access to the /sitecore folder locally to do this.
    • Warm up the site on the CD and test it
    • Add it back into the load balancer
    • Move on to the next CD server

That way, you give the CD time to rebuild the index without having that server "live", once the index is ready and the site works, it takes over the traffic and you move on until all the CD's are done. This is how I did it in the pre-solr days.

  • 1
    Thanks for the feedback Richard, really appreciated. This is indeed for a zero downtime deployment and we won't have the luxury of installing SOLR for this one. I'm thinking we should disable publishing on the management box to prevent any unwanted re-indexing jobs during the deployment and, as you mentioned, enable access to the Sitecore client on each delivery server while it is out of the load balancer so we can trigger a re-index job on that server only; hopefully meaning the indexes on the other delivery servers will stay the same. – R. Allinson Feb 28 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.