Skip to main content

restoredatastore

This utility is used with all ArcGIS Data Store types.

If you lose access to the data used by your hosted layers, use your backup files and the restoredatastore utility to recover the data store.

If you cannot recover the data store, install ArcGIS Data Store on a new machine, do not configure the data store, and restore the last full backup to the new machine.

If you use a relational store and need to roll the hosted feature layer data back to a specific time in the past, restore on top of the existing relational store.

Note:

The relational store must be configured to support point-in-time recovery, and you can only restore to a previous relational store state for which you have backup files available. For example, if you only retain backups for five days, you can only recover the data store to a point in time within those five days.

The restoredatastore utility must be run on the primary relational store machine. The utility can be run on any of the spatiotemporal big data store, graph store, or object store machines.

Note:

To discover which backup files you can use to restore, run the listbackups utility.

Syntax

restoredatastore [options]

Supported options are listed in the table below:

Option

Description

--store

Indicates the type of data store to restore.

Valid values are relational, spatiotemporal, graph, or object.

--target

Valid values are most-recent, the timestamp of the backup file in the format <yyy-mm-dd-hh:mm:ss>, or the name of the backup file.

All data store types support the backup file name with the target option. A timestamp and most-recent are only supported for relational stores.

When restoring after a crash or to move the relational store, specify --target most-recent. If restoring a relational store to a point in time—which requires that the relational store be configured to allow point-in-time recovery—specify the date and time (in UTC) to which you need to restore the data store. If you have a specific backup file to restore, specify the backup file name instead. If you do not specify a target, the most recent backup is restored.

--source-loc

This is the top-level directory where the backup files you want to use to restore the data store are located. This will be the path to a file share location, a backup location name, or an Amazon S3 or Azure Blob Storage backup location.

Tip:

To obtain backup source locations, you can run the configurebackuplocation utility with the --operation option set to list. If you cannot run the configurebackuplocation utility—for example, if the data store machine crashed and you are restoring to a new machine to recover the data store—you can identify the backup source location by the presence of a file named agsds_backup_sig.

--bound

Valid values are true or false.

The --bound option is only supported with the relational store.

By default, it is assumed that you are restoring the relational store to work with the same GIS Server site it was registered with when you created the backup. Only specify --bound false to restore the data store without maintaining the association with the data store's GIS Server site. If you moved the hosted services to a different GIS Server, you can set the --bound option to false and specify the new GIS Server site's URL with the --server-url option when you restore.

You could also restore the relational store unbound from its GIS Server as a last resort if the GIS Server site was lost and could not be recovered; you could restore the data store unbound and configure it with a new federated GIS Server site. However, the layers that used the data in the data store would no longer exist. You would have to connect to the data store database to extract the data to another format and republish it to ArcGIS Enterprise.

--data-dir

This is the ArcGIS Data Store directory on the machine where you are restoring the database. Only use --data-dir if you are restoring the data store to a new machine. When restoring to a new machine, you must also specify the --source-loc option.

--server-url

If you specify --bound true (or omit the --bound option) to keep the data store registered with the same GIS Server site it was registered with when you created the backup, specify the URL of that GIS Server site. If you specify --bound true and have moved your services to a new GIS Server site, use the --server-url option to specify the URL of the new GIS Server site. If you specify a new site URL and have not moved the services to this new server, the data in the data store will not be accessible.

--server-admin

This option is required if you specify --bound true or do not specify the --bound option. Supply the username of the ArcGIS Server administrator.

--server-password

This option is required if you specify --bound true or do not specify the --bound option. Supply the password for the ArcGIS Server administrator.

--loaddata

Supported with the spatiotemporal big data store and graph and object stores.

Valid values are true or false.

Set this option to false when you need to restore the data store to a new set of machines, but the data will not fit on the first machine. This allows you to restore the data store's schema, add more machines to the data store to accommodate all the data, and then run the restoredatastore utility again with --loaddata set to true to restore the data. By default, this option is set to true.

--mode

Valid values are singleInstance or cluster.

When you restore a graph store or object store to a new machine, you can specify cluster to change the data store from single instance to cluster mode, or specify singleInstance to change the data store from cluster to single instance mode.

--prompt

Valid values are yes or no.

When you run this utility, you are prompted to confirm the action you specified. If you automate the use of this utility, set the --prompt option to no; otherwise, the script will not proceed until you answer the prompt.

Examples

In this example, the most recent backup is in a backup location named rdsbackups and will be restored to the existing data store. Because the default store type is relational, and it remains bound by default to the GIS Server site with which it was registered, you do not have to specify --store relational or --bound true. However, you do have to specify the GIS Server URL and administrator credentials.

./restoredatastore.sh --target most-recent --source-loc rdsbackups --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target most-recent --source-loc rdsbackups --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting 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

In this example, a relational store that has point-in-time recovery enabled is restored from the relational store backup location on a network share to the state it was in at 2:30 p.m. (UTC) on July 17, 2014.

./restoredatastore.sh --target 2014-07-17-14:30:00 --source-loc /net/sharedserver/entbackups/relds --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target 2014-07-17-14:30:00 --source-loc \\sharedserver\entbackups\relds --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting 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

In this example, the relational store is restored to a new machine using a backup file named movedatastore. When you restore to a new machine, you must specify the location of the backup file and the location of the new ArcGIS Data Store content directory. Because the hosted feature services are still running on the same GIS Server site with which the relational store is registered, --bound true is not required, but the GIS Server URL and administrator credentials are required.

./restoredatastore.sh --target movedatastore --source-loc /net/buserver/data/backups --data-dir /usr/datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target movedatastore --source-loc \\buserver\data\backups --data-dir C:\datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting 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

In the following example, a spatiotemporal big data store backup file (bds1) is restored from a named backup location (awsloc).

./restoredatastore.sh --target bds1 --store spatiotemporal --source-loc 'name=awsloc' --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target bds1 --store spatiotemporal --source-loc name=awsloc --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting 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

See Recover a data store for steps and an example of restoring a spatiotemporal big data store after hardware failure.

In this example, the graph store is restored to a new machine. When you restore to a new machine, you must specify the location of the backup file and the location of the new ArcGIS Data Store content directory. Because the knowledge graph layers are still running on the same GIS Server site with which the graph store is registered, --bound true is not required, but the GIS Server URL and administrator credentials are required.

./restoredatastore.sh --store graph --source-loc /net/buserver/kgdata/backups --data-dir /usr/datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --store graph --source-loc \\buserver\kgdata\backups --data-dir C:\datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $SAup.4s