7

I am midst of migrating a Sitecore project to Azure Paas offering. I've completed the deployment of the files (ie. dlls, configs, css, js, etc) and were able to do a complete unicorn sync. That looks very promising!

However, I've reached the point that I need to migrate my solr core indexes to azure search and was shocked that Azure Search doesn't give you an option to migrate solr indexes schema and data into AS. (I will be thankful already if I can migrate the schema even without the data as this is only for UAT)

So my first question is, is there a way to import my solr indexes schema without manually creating those in Azure search. I am trying to avoid to define ALL the fields one by one. (guys, don't crucify us.. the developers, pls pls pls).

enter image description here

Note that the Import data option is limited to Azure SQL database, SQL server relational data, Azure Cosmos, Azure blog storage and Azure Table storage only. https://docs.microsoft.com/en-us/azure/search/search-import-data-portal

My alternative solution to my problem is to copy an existing Azure Search Sitecore index Ie. Sitecore-Master-Index, but I don't see that option as well.

enter image description here

Another thing to note, if your Solr indexes naming convention has underscore (_), in Azure Search you are not allowed to add special characters except lowercase letters, digits or dashses.

Feel free to comment if you have ideas, workaround or solution, any tools to use. Thanks.

4
  • 5
    There is no need to create them manually: According to the documentation, it's a matter of defining them in your configfiles. Please check this documentation provided by Sitecore. It, by the way, does support underscores.
    – Bas Lijten
    Nov 3, 2017 at 13:31
  • 1
    As Bas said - no need to migrate indexes, by their very nature indexes are transient. Just reindex your site once you are deployed and all the config has been setup correctly and that will populate your indexes.
    – Richard Seal
    Nov 3, 2017 at 13:40
  • @BasLijten, i had a problem with Azure search with one underscore prefix of the field name. but it did not complain when the prefix was having two underscore. Nov 3, 2017 at 17:02
  • Thanks, Bas. Please put your comment into an answer, so i can mark it as the solution. With regards to the underscore, what I meant is that if you created an index manually from Azure search, it won't accept underscore or other special characters, however, I will agree that when you defined it from your configuration, during indexing via sitecore control panel. Sitecore will respect the _ but will use - upon creation of that index in Azure search. Nov 4, 2017 at 8:13

2 Answers 2

3

We don't need to migrate the indexes from Solr to Azure. but you need to change the index configuration to get it working on Azure Search (for custom indexes)

For standard Indexes

  1. go to your App Service and Disable all the index configs in App_config/Sitecore/ContentSearch this will disable all Solr indexes.

  2. go to your App Service and Enalbe all the index configs in App_config/Sitecore/ContentSearch.Azure this will enalbe all Azure indexes.

Note: Azure search doesn't need populating of indexes too.

For custom Indexes, follow this steps to change the Solr index configuration to make it work in Azure Search

  1. Change search:require="Azure" on <sitecore> node
  2. Add <param desc=”totalParallelServices”>5</param> under <index> node
  3. Remove <param desc=”core”>$(id)</param>
  4. Change configuration reference from defaultSolrIndexConfiguration to defaultCloudIndexConfiguration
  5. Change documentOptions type from Sitecore.ContentSearch.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider to Sitecore.ContentSearch.DocumentBuilderOptions, Sitecore.ContentSearch
  6. Add attribute cloudFieldName for all computed index fields. E.g, cloudFieldName="c_computed_field"

once you update all this fields and deploy it your Azure Instance, you will be able to rebuild the indexes.

Hope this helps

0

indexing doesn't need any migration. You have to configure any custom indexes then rebuild the indexes from Sitecore or azure indexes dashboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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