Recover a data store
In this topic
If you lose access to the data used by your portal's hosted feature layers—for example, your data store crashes or an editor deletes the wrong data from a hosted feature layer—you can restore the data using your backup files.
In the case where the data store crashes, install ArcGIS Data Store on a new machine and restore the latest available backup using the restoredatastore utility. To recover feature layer data to a specific point in time, restore on top of the existing data store and specify a date and time to which you want to restore.
The backup files you use for recovery are compressed. When you restore your data, these files must be uncompressed to a staging location. That means you need to have a staging location that can accommodate this data. By default, the files are staged in your data directory.
Tip:
If you have a lot of data in your data store, you might want to set up a separate staging location and specify that for database recovery. You can specify a separate staging location using the changestaginglocation utility.
Be aware that clients and services cannot access the data store while you are restoring it.
Restore after a crash
If the hardware stops functioning or the data store is unavailable and cannot be brought back online, install ArcGIS Data Store on a new machine, and apply your backup files to it using the restoredatastore utility. This restores the feature layer data in your data store and keeps the data store registered with the existing ArcGIS Server site. Be aware, though, that caches for existing scene layers will not be restored.
- Install ArcGIS Data Store on a new machine.
- Open a Command Prompt using the Run As Administrator option.
- Run the restoredatastore utility found in <ArcGIS Data Store installation directory>\datastore\tools to restore the most recent backup of the data store.The syntax to restore the data store to a new machine is as follows:
restoredatastore --target most-recent --source-loc <location of backup files> --bound <true|false> --data-dir <new data store directory>
This example restores the most recent backup from \\fortknox\backups\datastore to C:\arcgisdatastore. Since the data store remains bound by default to the ArcGIS Server site with which it was registered, you do not have to specify --bound true.
restoredatastore --target most-recent --source-loc \\fortknox\backups\datastore --data-dir C:\arcgisdatastore You are going to restore the data store from a data store backup. This process could take a long time, depending on the size of your data. Please do not interrupt the process once it has started. Do you want to continue (Yes or No)? Yes
If the specified directory does not already exist, it will be created. If it does exist, you must have write access to it and it must be empty. If not, the restore operation will fail.
- Confirm that you want to restore the data store by typing yes.
- Open the Windows Services interface and restart the ArcGIS Data Store service.
Restore an existing data store to a specific point in time
You can choose to what point in time you want to recover an existing data store's feature layer data. For example, if an editor makes extensive edits to data in a feature layer, then discovers the next day that those edits were incorrect, you can restore the data store to the state it was in prior to those edits.
Times specified must be in Coordinated Universal Time (UTC).
Note:
Any feature layers published to the portal after the point in time to which you restore the data store will no longer be valid, because the data used by those layers will no longer exist in the data store.
- Open a Command Prompt using the Run As Administrator option.
- Run the restoredatastore utility found in <ArcGIS Data Store installation directory>/datastore/tools to restore the data to a specific point in time.
The syntax to restore the data store to specific point in time is as follows:
restoredatastore --target <date and time> --source-loc <location of backup files>
For example, type the following to restore the data store from files on \\fortknox\backups\datastore to the state it was in at 5:00 p.m. UTC on March 20, 2014:
restoredatastore --target 2014-03-20-17:00:00 --source-loc /net/fortknox/backups/datastore You are going to restore the data store from a data store backup. This process could take a long time, depending on the size of your data. Please do not interrupt the process once it has started. Do you want to continue (Yes or No)? Yes
- Confirm that you want to restore the data store by typing yes.
Tip:
If you want to script the restore command, include a flag to suppress the confirmation prompt, as in the following example:
restoredatastore --target 2014-03-20-17:00:00 --source-loc /net/fortknox/backups/datastore --prompt no
Your feature layer data will be restored to the point in time you specified.