Objects in Glacier
can only be restored to Standard
class.
How to restore an object from Glacier
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- An Object Storage bucket
- An object in Glacier storage class
To facilitate the steps of restoration and ensure fast restitution of your data, we recommend you store average-sized files (larger than 1 MB) in Glacier
, as opposed to several small files.
How to restore an object
-
Click Object Storage in the Storage section of the side menu. The list of your buckets displays.
-
Click the bucket name that contains the objects you want to restore to
STANDARD
class. The list of objects displays. -
Click «See more Icon», then select Restore from the drop-down menu.
A pop-up appears.
-
Enter the number of days after which the object will be transferred back to
Glacier
, or click the toggle to permanently restore the object. -
Click Restore object from Glacier.
Your object remains available in Standard
class for the duration you specified. It will be transferred automatically back to Glacier
once the configured period is over.
How to restore all objects in a bucket
If you have numerous files in a bucket that you would like to restore, we recommend using the command line interface, with a dedicated tool such as the AWS CLI.
-
Run the command below in a terminal to create a list of objects to restore, and store it as a text file. Make sure to replace
<YOUR-BUCKET>
with the name of your bucket.aws s3api list-objects-v2 --bucket <YOUR-BUCKET> --query "Contents[?StorageClass=='GLACIER']" --output text | awk '{print $2}' > glacier-restore.txtNoteThe
list-objects-v2
operation is limited to 1,000 objects. -
Run the following command to restore every object listed in the previous step. Make sure to replace
<YOUR-BUCKET>
with the name of your bucket, andNUM
with the desired number of days.for x in `cat glacier-restore.txt`doaws s3api restore-object --restore-request Days=NUM --bucket <YOUR-BUCKET> --key "$x"done
Use the Days=NUM
parameter to specify the desired number of days. By default, the restoration period is one day.
Restore time
The time it takes to restore an object depends on the size of the object and if multipart is configured. If your object is larger than 1 MB, it can take anywhere from a few minutes to 24 hours for the restore to start.
For multipart objects, each part is equivalent to one object. Consequently, the more parts your object has, the longer the restore time will be.
To determine how many parts a multipart object has, you can run the following aws-cli
command:
aws s3api <object-name> --bucket <bucket-name> --key b
For a multipart object, the Etag
includes a suffix that indicates the number of parts of the object. In the example below, the -<PartNumber>
is 14:
{"AcceptRanges": "bytes","LastModified": "2022-08-16T12:07:00+00:00","ContentLength": 141855946,"ETag": "\"df1c7b0641b048c77f7177e3d22dde78-14\"","VersionId": "1660651620102268","ContentType": "application/x-tar","Metadata": {}}
Therefore, in this example, the time it takes to restore the object (that has 14 parts) is equivalent to the time it takes to restore 14 objects.