Restoring files

This topic provides a brief description on how to restore files that have been migrated to the cloud storage tier if the original files are deleted from the GFPS file system.

This option provides a non-optimized (emergency) support for manually restoring files that have been migrated to the cloud storage tier if the original stub files on the GPFS file system are deleted.

Note: Transparent cloud tiering does not save off the IBM Storage Scale directory and associated metadata such as ACLs. If you want to save off your directory structure, you need use something other than Transparent cloud tiering.

Before restoring files, you must identify and list the files that need to be restored by issuing the mmcloudgateway files cloudList command.

Assume that the file, afile, is deleted from the file system but is present on the cloud, and you want to find out what versions of this file are there on the cloud. To do so, issue the following command:
mmcloudgateway files cloudList --file-versions /gpfs0/afile
The system displays output similar to this:

        id      datatime    datasize      metatime    metasize  filename
        13  Apr 27 03:34           6  Apr 27 03:34         499  /gpfs0/afile
        14  Apr 27 03:35          12  Apr 27 03:35         693  /gpfs0/afile
You can use the output of the cloudList command for restoring files. For more information on the cloudList command, see Listing files migrated to the cloud storage tier.
To restore files, issue a command according to this syntax:
mmcloudgateway files restore [-v] [--overwrite] [--restore-stubs-only]
                             { -F FileListFile | [--dry-run] [--restore-location RestoreLocation]
                             [ --id ID] [--] File}

By using this command, you can restore files in two different ways. That is, the files to be restored along with their options can be either specified at the command line, or in a separate file provided by the -F option.

If you want to specify the options in a file, create a file with the following information (one option per line):

filename=<name of the file to be retrieved>
target=<full path to restore the file>
id=<This is the unique ID that is given to each version the file (This information is available
in the cloudList output>. If the id is not given, then the latest version of the file will
be retrieved.
The following example shows how the content needs to be provided in a file (for example, filestoberestored) for restoring a single file /gpfs0/afile with multiple versions:

# Restoring filename /gpfs0/afile
   filename=/gpfs0/afile
   target=/gpfs0/afile-33
   id=33
   %%
   filename=/gpfs0/afile
   target=/gpfs0/afile-34
   id=34
   %%
   # Restoring filename /gpfs0/afile
   filename=/gpfs0/afile
   target=/gpfs0/afile-35
   id=35
   %%
   # Restoring filename /gpfs0/afile
   filename=/gpfs0/afile
   target=/gpfs0/afile-latest
   %%
   # Restoring filename /gpfs0/afile
   filename=/gpfs0/afile
The following example shows how the content needs to be provided in a file (for example, filestoberestored) for restoring the latest version of multiple files (file1, file2, and file3):

# Restoring filename /gpfs0/file1, /gpf0/file1, and /gpfs0/file3
   filename=/gpfs0/file1
   target=/gpfs0/file1
   %%
   filename=/gpfs0/file2
   target=/gpfs0/file2
   %%
   filename=/gpfs0/file3
   target=/gpfs0/file3

Files to be restored are separated by lines with %% and # represents the comments.

Now that you have created a file with all required options, you need to pass this file as input to the mmcloudgateway files restore command, as follows:
mmcloudgateway files restore -F filestoberestored
Note: It is advised not to run the delete policy if there is some doubt that the retention policy might result in deleting of the file before you can restore it.
For information on the description of the parameters, see the mmcloudgateway command .