.. _`ris-snapshot-recovery`: ============================== Recovering Data From Snapshots ============================== .. contents:: :local: :depth: 2 Overview ======== This document serves as a guide for current users with storage1 allocations who wish to recover data themselves from their ``.snapshots`` folder. Prerequisites ============= #. Meet the :ref:`assumptions ` listed for accessing storage1. #. A user account for RIS storage1. Manual Recovery Method ====================== .. note:: This method works better for small numbers of files or folders. If you are recovering a lot of data, it may be easier to use the command line instructions later in this document. 1. Navigate to your storage drive. ---------------------------------- If you already have hidden files enabled, great! You can skip to step 3. Otherwise, your window will look similar to the window below. **Mac Finder** .. image:: macos/mac-snapshot.png **Windows 10 File Explorer** .. image:: windows/win-snapshot.png 2. Enable hidden files and folders ---------------------------------- You will need to enable hidden files to see the ``.snapshots`` folder in your window. To enable hidden files on a Mac, press ``Command + Shift + Period``. Your Finder window should now look similar to the window below, with the ``.snapshots`` folder visible. .. image:: macos/mac-snapshot-hidden.png To enable hidden files on Windows 10, navigate to the ``Vie`` tab and click the checkbox marked ``Hidden Items``. The ``.snapshots`` folder should now be visible. .. image:: windows/win-snapshot-hidden.png 3. Restoring data from the ``.snapshots`` backup ------------------------------------------------ Open the ``.snapshots`` folder. You should see folders named by day. Viewing the ``.snapshots`` folder on Mac .. image:: macos/mac-snapshot-folder.png Viewing the ``.snapshots`` folder on Windows 10 .. image:: windows/win-snapshot-folder.png Navigate to the folder corresponding with the most recent day before the files/folders were corrupted or deleted or overwritten, and then into the ``Active`` folder. Select the files and folders you want to recover, then copy them (``Control + C`` on Windows, ``Command + C`` on macOS). Next, navigate back up to the main directory of your storage drive, and then into the ``Active`` folder. Paste the copied files (``Control + V`` on Windows, ``Command + V`` on macOS). Your files have been successfully restored! Command Line Recovery Method ============================ Windows ------- 1. Open your storage drive and navigate to the ``.snapshots`` folder. 2. Locate the file or folder you want to restore, and copy the path name * (e.g. ``\\storage1.ris.wustl.edu\tahan\.snapshots\Thu-tahan_active\Active\file.txt``). 3. Open Command Prompt. 4. For transferring a folder, type: .. code:: robocopy FOLDERPATH '\\storage1.ris.wustl.edu\DRIVENAME\Active\FOLDERNAME' /E /V /R:5 /W:5 /TBD /MT 5. Replace ``FOLDERPATH`` with the path to the folder from step 2, ``DRIVENAME`` with the name of your storage allocation (e.g. ``tahan``) and ``FOLDERNAME`` with the name of the folder you are transferring. .. note:: You can replace ``/MT`` with ``/MT:#`` (where # is a number from 1 to 128) to change the number of files robocopy processes simultaneously. ``/MT`` defaults to 8, so setting it to a number above 8 may increase transfer speed if you have a sufficiently powerful system and connection. 6. For transferring a file, type: .. code:: copy FILEPATH '\\storage1.ris.wustl.edu\DRIVENAME\Active' 7. Replace ``FILEPATH`` with the path to the file from step 2, and ``DRIVENAME`` with the name of your storage allocation (e.g. ``tahan``). Mac --- 1. Open your storage drive and navigate to the .snapshots folder. 2. Locate the file or folder you want to restore, and copy the path name. * (e.g. ``\\storage1.ris.wustl.edu\tahan\.snapshots\Thu-tahan_active\Active\file.txt``). 3. Open Terminal. 4. In Terminal, type: .. code:: rsync -avh PATH /Volumes/DRIVENAME/Active 5. Replace ``PATH`` with the path from step 2, and ``DRIVENAME`` with the name of your storage allocation (e.g. ``tahan``). Globus Recovery Method ====================== Snapshots can also be recovered using Globus. Please see the Globus :ref:`documentation ` for direction on accessing your storage allocation using the Globus interface. In the ``PATH`` field, enter in the path to your storage allocation, (e.g. ``/storage1/fs1/${STORAGE_ALLOCATION}``). Enable the hidden files and folder by clicking the ``Show Hidden Items`` button, highlighted in red below. .. image:: ../images/globus/globus-snapshot.png The ``.snapshots`` folder will now be visible. .. image:: ../images/globus/globus-snapshot-hidden.png Navigate to the file or folder you'd like to recover. Click the ``Transfer or Sync to...`` button to open a new destination pane to the right. Naviage to the ``Active`` folder of your storage allocation. In the example below, a Python script will be restored to the ``Active`` folder. .. image:: ../images/globus/globus-snapshot-transfer.png Click the ``Start`` button to begin your transfer. Your transfer job is now submitted to Globus. You will receive an email once the transfer is complete and the restored file will be available in the ``Active`` folder.