# Manage Snap-To-Object using the CLI

Using the CLI, you can:

* [Upload a  snapshot](#upload-a-snapshot)
* [Create a filesystem from an uploaded snapshot](#create-a-filesystem-from-an-uploaded-snapshot)
* [Manage synchronous snapshots](#manage-synchronous-snapshots)
* [Recover from a remote snapshot](#recover-from-a-remote-snapshot)

## Upload a  snapshot

**Command:** `weka fs snapshot upload`

Use the following command line to upload an existing snapshot:

`weka fs snapshot upload <file-system> <snapshot> [--site site]`

**Parameters**

<table><thead><tr><th width="186.33333333333331">Name</th><th>Value</th><th>Default</th></tr></thead><tbody><tr><td><code>file-system</code>*</td><td>Name of the filesystem</td><td></td></tr><tr><td><code>snapshot</code>*</td><td>Name of the snapshot of the <code>&#x3C;file-system></code> filesystem to upload.<br></td><td></td></tr><tr><td><code>site</code>*</td><td>Location for the snapshot  upload.<br>Mandatory only if both <code>local</code> and <code>remote</code> buckets are attached.<br>Possible values: <code>local</code> or <code>remote</code></td><td>Auto-selected if only one bucket for upload is attached.</td></tr></tbody></table>

## Create a filesystem from an uploaded snapshot

**Command:** `weka fs download`

Use the following command line to create (or recreate) a filesystem from an existing snapshot:

`weka fs download <name> <group-name> <total-capacity> <ssd-capacity> <obs-bucket> <locator> [--additional-obs additional-obs] [--snapshot-name snapshot-name] [--access-point access-point]`

When creating a filesystem from a snapshot, a background cluster task automatically prefetches its metadata, providing better latency for metadata queries.

**Parameters**

<table><thead><tr><th width="212">Name</th><th width="317">Value</th><th>Default</th></tr></thead><tbody><tr><td><code>name</code>*</td><td>Name of the filesystem to create.</td><td></td></tr><tr><td><code>group-name</code>*</td><td>Name of the filesystem group in which the new filesystem is placed.</td><td></td></tr><tr><td><code>total-capacity</code>*</td><td>The total capacity of the downloaded filesystem.</td><td></td></tr><tr><td><code>ssd-capacity</code>*</td><td>SSD capacity of the downloaded filesystem.</td><td></td></tr><tr><td><code>obs-bucket</code>*</td><td>Object store name for tiering.</td><td></td></tr><tr><td><code>locator</code>*</td><td>Object store locator obtained from a previously successful snapshot upload.</td><td></td></tr><tr><td><code>additional-obs</code></td><td>An additional object store name.<br>If the data to recover resides in two object stores (a second object store attached to the filesystem, and the filesystem has not undergone full migration), this object store is attached in <code>read-only</code> mode.<br>The snapshot locator must be in the primary object store specified in the <code>obs</code> parameter.</td><td></td></tr><tr><td><code>snapshot-name</code></td><td>The downloaded snapshot name.</td><td>The uploaded snapshot name.</td></tr><tr><td><code>access-point</code></td><td>The downloaded snapshot access point. </td><td>The uploaded access point.</td></tr></tbody></table>

The `locator` can be a previously saved locator for disaster scenarios, or you can obtain the `locator` using the `weka fs snapshot` command on a system with a live filesystem with snapshots.

If you need to pause and resume the download process, use the command: `weka cluster task pause / resume`. To abort the download process, delete the downloaded filesystem directly. For details, see [Manage background tasks](https://docs.weka.io/4.2/usage/background-tasks#managing-background-tasks).

{% hint style="info" %}
Due to the bandwidth characteristics and potential costs when interacting with remote object stores it is not allowed to download a filesystem from a remote object store bucket. If a snapshot on a local object store bucket exists, it is advisable to use that one. Otherwise, follow the procedure in [Recover from a remote snapshot](https://docs.weka.io/4.2/fs/snap-to-obj/..#recover-from-a-remote-snapshot).&#x20;
{% endhint %}

{% hint style="info" %}
For encrypted filesystem, when downloading, you must use the same KMS master key to decrypt the snapshot data. For more information, see the [KMS Management](https://docs.weka.io/4.2/usage/security/kms-management#overview) section.
{% endhint %}

## Manage synchronous snapshots

{% hint style="warning" %}
The **Synchronous Snap** feature, which allows incremental snapshots to be downloaded from an object store, was temporarily disabled in version 4.2.3. It has been re-enabled in version 4.3.0.
{% endhint %}

## Recover from a remote snapshot

When recovering a snapshot residing on a remote object store, it is required to define the object store bucket containing the snapshot as a local bucket.

A remote object store has restrictions over the download, and we want to use a different local object store due to the QoS reasons explained in [Manage object stores](https://docs.weka.io/4.2/managing-object-stores#overview).

To recover a snapshot residing on a remote object store, create a new filesystem from this snapshot as follows:

1. Add a new local object store, using `weka fs tier obs add` CLI command.
2. Add a local object store bucket, referring to the bucket containing the snapshot to recover, using `weka fs tier s3 add.`
3. Download the filesystem, using `weka fs download.`
4. If the recovered filesystem should also be tiered, add a local object store bucket for tiering using `weka fs tier s3 add.`
5. Detach the initial object store bucket from the filesystem.
6. Assuming you want a remote backup to this filesystem, attach a remote bucket to the filesystem.
7. Remove the local object store bucket and local object store created for this procedure.
