# Offline Restoration - Non Autoscaling

New volumes that are created directly from a Datafy snapshot cannot be read without Datafy AutoScaler installed. If you wish to access the data on these volumes when AutoScaler cannot be installed, you can use the Datafy restoration tool to migrate the data to a new, full sized volume (similarly to when autoscaling is deactivated by AutoScaler). After this, the resulting volume can be used as-is for any purpose.

The tool does not require any permissions on your AWS account, and only performs local copy operations.

{% hint style="warning" %}
The offline restoration tool is intended to access to data from a Datafy snapshot in cases of emergency, and is not intended for routinely creating a non-autoscaling volume from Datafy snapshots. For this case, restore your snapshots through the [standard flow](https://docs.datafy.io/volume-lifecycle/datafy-snapshots/..#restoring-a-volume-from-a-datafy-snapshot) and then [deactivate autoscaling](https://docs.datafy.io/managing-autoscaling-volumes#deactivating-autoscaling) for the new volume.
{% endhint %}

## Offline Restoration of Datafy Snapshots

Before you get started, make sure you meet the following conditions:

1. Access to snapshots in the AWS console
2. SSH access and root/sudo permissions on a Linux instance where the volumes will be attached

{% stepper %}
{% step %}

### Create new volumes from snapshots

* For a given source volume ID and desired timeframe, find all of the snapshots that have a matching `datafy:source-volume:id` tag and timestamp. All the snapshots should have the same `datafy:snapshot:id` tag, and all of snapshots with this tag should be used.
* Create new volumes from these snapshots through AWS, and attach them to the desired instance.&#x20;
  {% endstep %}

{% step %}

### Set up restoration tool

Download and run the restoration tool, on the instance the volumes are attached to. The downloader automatically retrieves the latest version that matches the instance type and architecture.

{% code overflow="wrap" %}

```bash
curl -sSfL https://artifacts.datafy.io/restore_tool | sh
```

{% endcode %}

To install a specific version, use

{% code overflow="wrap" %}

```bash
 curl -sSfL https://artifacts.datafy.io/restore_tool | sh -s -- --version <version>
```

{% endcode %}
{% endstep %}

{% step %}

### Create a new full-sized volume

1. Create a new volume, with a size equal to the original size of the snapshots' source volume (the size of the filesystem). You can find this original size in several ways:
   * If the original volume still exists:
     * If it is autoscaling, you can view its size in the Datafy dashboard or check the size of its filesystem.
     * If it is not autoscaling, you can check its size in the AWS console as well
   * Save the size returned when creating snapshots
   * Use the restoration tool to check the required size, with:&#x20;

     ```bash
     sudo ./run_restore_tool.sh \
       --restoration_source_volume_ids vol-source456 vol-source789 \
       --get_size
     ```

     \
     The required size will be printed to the console, for example:

     ```
     ✅ Required destination volume size: 100.00 GB
        Exact size in bytes: 107,374,182,400
        Chunk count: 3,276,800
        Chunk size: 32.00 KB
        RAID stripe size: 1.00 MB
     ```
2. Attach the new volume to your instance
   {% endstep %}

{% step %}

### Complete restoration

* Run the restoration tool, providing the IDs of the restored and new volumes. You can identify the volumes using their IDs (preferred) or their device names&#x20;

{% tabs %}
{% tab title="Volume IDs" %}
{% code overflow="wrap" %}

```bash
sudo ./run_restore_tool.sh \
  --new_vol_id vol-destination123 \
  --restoration_source_volume_ids vol-source456 vol-source789
```

{% endcode %}
{% endtab %}

{% tab title="Device name" %}

```bash
sudo ./run_restore_tool.sh \
  --devices /dev/nvme0n1 /dev/nvme1n1 \
  --output /dev/nvme2n1
```

{% endtab %}
{% endtabs %}

* Monitor the progress of you restoration in the console output
* After the restoration is complete, mount the full-sized volume, and delete the volumes created from the snapshots
  {% endstep %}
  {% endstepper %}
