5

I am using Azure search and would like to make sure I can recover from a self inflicted disaster before I push more docs in there. How do I backup my index?

Is creating Azure Search replicas equivalent to making a backup? How would one restore that?

Thanks

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
Rob Foree
  • 375
  • 3
  • 15

4 Answers4

1

Microsoft have released a console app on github that can be used to backup and restore Azure Search Indexes - its not perfect, but I use it almost daily for backup and restores from prod to CI/QC/Dev instances

https://learn.microsoft.com/en-us/samples/azure-samples/azure-search-dotnet-samples/azure-search-backup-restore-index/

JGilmartin
  • 8,683
  • 14
  • 66
  • 85
0

Right now you can't do that from the API or the portal, just save a copy of the JSON schema to a .js file, for example. See the Get Index API.

Normally you don't need to touch the index very often, only add, update or remove documents.

Adrianne
  • 260
  • 3
  • 11
0

You would need to use an indexer from an external source to push the data into Search and be able to create backups at the same time.

If its an AzureSQL database, this may do it for you automatically, depending on your subscription

Create a table with the same fields in the Azure Search Index and add a deleted flag and a last update date, then import all of your data into the database. Set the date flag to the time that you imported the data.

At the top of the azure search bar, there is an option to 'Import Data'. This will allow you to connect the data source, this way you can create an index which will look at the last modified data and deleted flag when you create the connection.

The wizard will take you through all of the options

From there, just update the SQL table with your changes and the indexer will automatically push them to Azure search.

Tony
  • 28
  • 5
0

Thank you for an answer about https://learn.microsoft.com/en-us/rest/api/searchservice/Get-Index

Sometimes Azure Search index it's an only source to restore data. For example in Microsoft QnA maker - if you will delete azure web app or azure app service- you no longer can even export Knowledge base from QnA maker.

To somehow restore data from QnA maker- I used Azure Search index.

Igor Sychev
  • 71
  • 1
  • 1
  • 4