Backups and version management

Backing up your assets allows you to maintain a version history of individual assets, letting you view, download or restore previous revisions as well as retrieving deleted assets if needed. When you upload an asset while backups are enabled, the uploaded file is automatically backed up. You can either use Cloudinary's default backup storage, or set up your own storage bucket (paid accounts only).

Overview

Watch this video tutorial for an overview:

Enabling automatic backup

By default, backup is turned off. Enabling automatic backup means that every uploaded asset is also copied to a secondary write-protected location, while keeping multiple revisions per file. If using Cloudinary's default backup storage, this counts against your storage usage.

Important
If you intend to use your own backup storage, do not enable automatic backup until you set up your storage bucket.

To enable backup of your Cloudinary-managed assets, set Automatic backup to Enabled in the Upload tab of the console Settings page and click Save to activate backups for all newly uploaded assets.

Screenshot of automatic backup setting

To back up the existing files in your account, click Perform initial backup. When the backup is complete, an email is sent to the notification email address that you specify in the confirmation box.

Notes

  • If you have many assets in your account at the time you initiate the backup, you will be routed to a page where you can request for Cloudinary customer support to perform the initial backup.
  • An asset backup occurs when the asset itself is replaced with a new version. Other changes to an asset, such as updates to tags or metadata do not trigger a backup.
  • Remotely fetched assets, including Facebook and Twitter profile pictures, are not backed up because they can be automatically re-created at any time. In addition, Cloudinary keeps backup copies only for your original assets and not the derived (transformed) versions of these originals, as these too can be re-generated on demand.

Using your own backup storage

Paid accounts have the option to back up to a designated storage bucket, either through Amazon Simple Storage Service (Amazon S3) or Google Cloud Storage, instead of using Cloudinary's default backup location. These backups do not count against your Cloudinary storage usage.

Notes

  • When using your own backup storage, the backup location should not be touched or modified in any way. Additionally, no archiving policy should be enforced on that location (such as an archive policy to a glacier on S3 buckets).
  • If you have already backed up files to one storage location (including Cloudinary's default backup), then change to a different storage bucket, we recommend contacting support to ensure that a full backup is written to your new bucket.

Backing up to Amazon S3

To configure automatic backups to an Amazon S3 bucket:

  1. Create your Amazon S3 bucket using this naming convention:
    {XXX}-{region}, for example: mybucket-eu-central-1

    For {region}, use the AWS list of supported regions.

  2. Grant full access permissions to Cloudinary's AWS account, info@cloudinary.com. Follow the instructions for granting Access for other AWS accounts, entering either info@cloudinary.com or our Canonical ID a6cb2907a1f29bc5207045273827a60922bfc149c91d024f39d243aa7d1a4110 in the Grantee field.

    Note
    If you use AWS CloudFormation, you can create the backup bucket using CloudinaryS3Backup.json.

  3. In your Cloudinary management console, go to the Settings page and select the Upload tab. Enter the name of your S3 bucket in the Backup S3 bucket field and click Save.

    Screenshot of setting S3 bucket

  4. Enable automatic backup and click Perform initial backup to back up your current assets to your S3 bucket. Any new uploaded assets will be automatically backed up to this bucket.

Backing up to Google Cloud Storage

To configure automatic backups to a Google Cloud storage bucket:

  1. Create a Google Cloud storage bucket using this naming convention:
    {XXX}-gs-cld, for example: mycloud-gs-cld

    Make sure to select the Fine-grained access control method when creating the bucket.

  2. Grant full access permissions to Cloudinary by adding service@cloudinary-gcs-production.iam.gserviceaccount.com as a member with the Storage Object Admin role.

  3. In your Cloudinary management console, go to the Settings page and select the Upload tab. Enter the name of your Google Cloud bucket in the Backup S3 bucket field and click Save.

    Screenshot of setting S3 bucket

  4. Enable automatic backup and click Perform initial backup to back up your current assets to your Google Cloud storage bucket. Any new uploaded assets will be automatically backed up to this bucket.

Overriding the global backup setting

You can selectively override the global backup setting when uploading a specific file by setting the backup parameter in the upload API call.

For example, if the global backup setting isn't enabled, setting the backup parameter to true when uploading the file sample.jpg, ensures that the uploaded file is backed up:

Ruby:
Copy to clipboard
Cloudinary::Uploader.upload("sample.jpg", 
  :backup => true)
PHP:
Copy to clipboard
\Cloudinary\Uploader::upload("sample.jpg", 
  array("backup" => true));
Python:
Copy to clipboard
cloudinary.uploader.upload("sample.jpg", 
  backup = True)
Node.js:
Copy to clipboard
cloudinary.v2.uploader.upload("sample.jpg", 
  { backup: true }, 
  function(error, result) {console.log(result, error); });
Java:
Copy to clipboard
cloudinary.uploader().upload("sample.jpg", 
  ObjectUtils.asMap("backup", true));
.Net:
Copy to clipboard
var uploadParams = new ImageUploadParams(){
  File = new FileDescription(@"sample.jpg"),
  Backup = true};
var uploadResult = cloudinary.Upload(uploadParams);
iOS:
Copy to clipboard
let params = CLDUploadRequestParams()
  .setBackup(true)
var mySig = MyFunction(params)  // your own function that returns a signature generated on your backend
params.setSignature(CLDSignature(signature: mySig.signature, timestamp: mySig.timestamp))
let request = cloudinary.createUploader().signedUpload(
  url: "sample.jpg", params: params)

Versioning

You can list, preview and restore previous versions of an asset from the asset management drill down page by clicking Version History, either from the Summary tab, or from the kebab menu:

screenshot of manage page with 'Version History' highlighted

To preview a specific version of the asset, click its preview icon. To restore a previous version, click the Restore link next to the listed version.

screenshot of revisions

You can do the same from the Edit page by clicking View backed up versions. This page has an additional indication of the asset's backup status: a small gray safe icon means the asset is backed up, whereas a red safe icon means the asset has additional historical revisions.

screenshot of edit page with 'View backed up version' highlighted

Restoring deleted assets from backup

You can restore deleted assets from backup either programmatically, or via the Media Library.

Restoring deleted assets programmatically

To restore deleted assets from backup programmatically, use the restore method of the admin API. For example, to restore deleted assets with the public_ids 'image1' and 'image2':

Ruby:
Copy to clipboard
Cloudinary::Api.restore(["image1", "image2"])
PHP:
Copy to clipboard
$api->restore(array("image1", "image2");
Python:
Copy to clipboard
cloudinary.api.restore(["image1", "image2"])
Node.js:
Copy to clipboard
cloudinary.v2.api.restore(["image1", "image2"],
  function(error, result) {console.log(result, error); });
Java:
Copy to clipboard
cloudinary.api().restore(Arrays.asList("image1", "image2"),
  ObjectUtils.emptyMap());
.Net:
Copy to clipboard
var publicIds = new List<string>(){"image1", "image2"};
cloudinary.Restore(publicIds);
cURL:
Copy to clipboard
curl \
 -d "public_ids[]=image1&public_ids[]=image2" \
 -X POST \
 https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload/restore
CLI:
Copy to clipboard
cld admin restore "image1","image2"

Restoring deleted assets via the Media Library

To restore deleted assets through the Media Library, use the advanced search to find assets of type, Deleted asset.

screenshot of deleted assets

You can optionally narrow the search down further using other Advanced Search options, then double-click the asset you want to restore. Select a specific version to restore as described in Versioning, either by clicking Restore in the Preview area, or Version History in the Summary tab.

✔️ Feedback sent!