|
@@ -18,18 +18,19 @@ PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true
|
|
|
|
|
|
////
|
|
|
|
|
|
-A snapshot can be restored using the following command:
|
|
|
+Use the <<restore-snapshot-api,restore snapshot API>> to restore
|
|
|
+a snapshot of a cluster or specified data streams and indices:
|
|
|
|
|
|
[source,console]
|
|
|
-----------------------------------
|
|
|
POST /_snapshot/my_backup/snapshot_1/_restore
|
|
|
-----------------------------------
|
|
|
+// TEST[s/_restore/_restore?wait_for_completion=true/]
|
|
|
|
|
|
By default, all data streams and indices in the snapshot are restored, but the cluster state is
|
|
|
-*not* restored. It's possible to select specific data streams or indices that should be restored as well
|
|
|
-as to allow the global cluster state from being restored by using `indices` and
|
|
|
-`include_global_state` options in the restore request body. The list
|
|
|
-supports <<multi-index,multi-target syntax>>.
|
|
|
+*not* restored. Use the `indices` parameter to restore only specific data streams or indices. This parameter
|
|
|
+supports <<multi-index,multi-target syntax>>. To include the global cluster state, set
|
|
|
+`include_global_state` to `true` in the restore request body.
|
|
|
|
|
|
[WARNING]
|
|
|
====
|
|
@@ -52,10 +53,10 @@ If no index template matches a data stream, the stream cannot
|
|
|
|
|
|
The `rename_pattern`
|
|
|
and `rename_replacement` options can be also used to rename data streams and indices on restore
|
|
|
-using regular expression that supports referencing the original text as
|
|
|
-explained
|
|
|
-http://docs.oracle.com/javase/6/docs/api/java/util/regex/Matcher.html#appendReplacement(java.lang.StringBuffer,%20java.lang.String)[here].
|
|
|
+using regular expression that supports referencing the original text, according to the https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#appendReplacement-java.lang.StringBuffer-java.lang.String-[`appendReplacement`] logic.
|
|
|
|
|
|
+[[rename-restored-data-stream]]
|
|
|
+// tag::rename-restored-data-stream-tag[]
|
|
|
If you rename a restored data stream, its backing indices are also
|
|
|
renamed. For example, if you rename the `logs` data stream to `restored-logs`,
|
|
|
the backing index `.ds-logs-000005` is renamed to `.ds-restored-logs-000005`.
|
|
@@ -66,6 +67,7 @@ If you rename a restored stream, ensure an index template matches the new stream
|
|
|
name. If no index template matches the stream, it cannot
|
|
|
<<manually-roll-over-a-data-stream,roll over>> or create new backing indices.
|
|
|
====
|
|
|
+// end::rename-restored-data-stream-tag[]
|
|
|
|
|
|
Set `include_aliases` to `false` to prevent aliases from being restored together
|
|
|
with associated indices.
|
|
@@ -92,8 +94,8 @@ pipelines, and {ilm-init} policies are restored into the current cluster. This
|
|
|
overwrites any existing cluster settings, templates, pipelines and {ilm-init}
|
|
|
policies whose names match those in the snapshot.
|
|
|
|
|
|
-The restore operation can be performed on a functioning cluster. However, an
|
|
|
-existing index can be only restored if it's <<indices-open-close,closed>> and
|
|
|
+The restore operation must be performed on a functioning cluster. However, an
|
|
|
+existing index can be only restored if it's <<indices-close,closed>> and
|
|
|
has the same number of shards as the index in the snapshot. The restore
|
|
|
operation automatically opens restored indices if they were closed and creates
|
|
|
new indices if they didn't exist in the cluster.
|
|
@@ -110,7 +112,7 @@ added to any existing data streams. For example, if only the `.ds-logs-000003`
|
|
|
backing index is restored from a snapshot, it is not automatically added to the
|
|
|
existing `logs` data stream.
|
|
|
|
|
|
-[float]
|
|
|
+[discrete]
|
|
|
=== Partial restore
|
|
|
|
|
|
By default, the entire restore operation will fail if one or more indices or backing indices participating in the operation don't have
|
|
@@ -119,11 +121,13 @@ restore such indices by setting `partial` to `true`. Please note, that only succ
|
|
|
restored in this case and all missing shards will be recreated empty.
|
|
|
|
|
|
|
|
|
-[float]
|
|
|
+[discrete]
|
|
|
=== Changing index settings during restore
|
|
|
|
|
|
-Most of index settings can be overridden during the restore process. For example, the following command will restore
|
|
|
-the index `index_1` without creating any replicas while switching back to default refresh interval:
|
|
|
+Use the <<restore-snapshot-api-index-settings,`index_settings`>> parameter
|
|
|
+to override index settings during the restore process. For example, the
|
|
|
+following request will restore the index `index_1` without creating any
|
|
|
+replicas while switching back to the default refresh interval:
|
|
|
|
|
|
[source,console]
|
|
|
-----------------------------------
|
|
@@ -141,11 +145,12 @@ POST /_snapshot/my_backup/snapshot_1/_restore
|
|
|
-----------------------------------
|
|
|
// TEST[continued]
|
|
|
|
|
|
-Please note, that some settings such as `index.number_of_shards` cannot be changed during restore operation.
|
|
|
+NOTE: Some settings such as `index.number_of_shards` cannot be changed during the restore operation.
|
|
|
|
|
|
For data streams, these index settings are applied to the restored backing
|
|
|
indices.
|
|
|
|
|
|
+// tag::index-settings-data-stream-warning[]
|
|
|
[IMPORTANT]
|
|
|
====
|
|
|
The `index_settings` and `ignore_index_settings` parameters affect
|
|
@@ -157,25 +162,27 @@ If you change index settings during a restore, we recommend you make similar
|
|
|
changes in the stream's matching index template. This ensures new backing
|
|
|
indices created for the stream use the same index settings.
|
|
|
====
|
|
|
+// end::index-settings-data-stream-warning[]
|
|
|
|
|
|
-[float]
|
|
|
+[discrete]
|
|
|
=== Restoring to a different cluster
|
|
|
|
|
|
-The information stored in a snapshot is not tied to a particular cluster or a cluster name. Therefore it's possible to
|
|
|
-restore a snapshot made from one cluster into another cluster. All that is required is registering the repository
|
|
|
-containing the snapshot in the new cluster and starting the restore process. The new cluster doesn't have to have the
|
|
|
-same size or topology. However, the version of the new cluster should be the same or newer (only 1 major version newer) than the cluster that was used to create the snapshot. For example, you can restore a 1.x snapshot to a 2.x cluster, but not a 1.x snapshot to a 5.x cluster.
|
|
|
+The information stored in a snapshot is not tied to a particular cluster or a cluster name. Therefore, it's possible to
|
|
|
+restore a snapshot created from one cluster into another cluster by registering the repository that contains the snapshot in the new cluster and starting the restore process.
|
|
|
|
|
|
-If the new cluster has a smaller size additional considerations should be made. First of all it's necessary to make sure
|
|
|
-that new cluster have enough capacity to store all data streams and indices in the snapshot. It's possible to change index settings
|
|
|
-during restore to reduce the number of replicas, which can help with restoring snapshots into smaller cluster. It's also
|
|
|
-possible to select only subset of the data streams or indices using the `indices` parameter.
|
|
|
+The topology of the new cluster does not have to match the cluster where the snapshot was created. However, the version of the new cluster must be the same or only one major version newer than the cluster that was used to create the snapshot. For example, you can restore a 5.x snapshot to a 6.x cluster, but not a 5.x snapshot to a 7.x cluster.
|
|
|
+
|
|
|
+If the new cluster has a smaller capacity, consider the following changes:
|
|
|
+
|
|
|
+* Ensure that the new cluster has enough capacity to store all data streams and indices in the snapshot.
|
|
|
+* Change the index settings during the restore operation to reduce the
|
|
|
+<<dynamic-index-number-of-replicas,number of replicas>>.
|
|
|
+* Use the `indices` parameter to choose only specific data streams or indices to restore.
|
|
|
|
|
|
If indices or backing indices in the original cluster were assigned to particular nodes using
|
|
|
-<<shard-allocation-filtering,shard allocation filtering>>, the same rules will be enforced in the new cluster. Therefore
|
|
|
-if the new cluster doesn't contain nodes with appropriate attributes that a restored index can be allocated on, such
|
|
|
-index will not be successfully restored unless these index allocation settings are changed during restore operation.
|
|
|
+<<shard-allocation-filtering,shard allocation filtering>>, the same rules will be enforced in the new cluster. If the new cluster does not contain nodes with appropriate attributes that a restored index can be allocated on, the
|
|
|
+index will not be successfully restored unless these index allocation settings are changed during the restore operation.
|
|
|
|
|
|
The restore operation also checks that restored persistent settings are compatible with the current cluster to avoid accidentally
|
|
|
restoring incompatible settings. If you need to restore a snapshot with incompatible persistent settings, try restoring it without
|
|
|
-the global cluster state.
|
|
|
+the <<restore-snapshot-api-include-global-state,global cluster state>>.
|