Whatever message this page gives is out now! Go check it out!

RestoreTableFromBackup

Last update:
May 18, 2026

Description

This function creates a backup from a table, which was previously created.
For more information, see RestoreTableFromBackup.

Category

History

ColdFusion (2021 release): Added this function.

Syntax

serviceHandle.restoreTableFromBackup(requestParameters)

Parameters

See request parameters of RestoreTableFromBackup.

Example

<cfscript> 
    cred = { 
    "credentialAlias" : "myalias", 
    "vendorName" : "AWS", 
    "region" : "us-east-2", 
    "secretAccessKey" : "xxxxx", 
    "accessKeyId" : "xxxx" 
  } 
      config = { 
        "serviceName" = "DYNAMODB" 
      } 
      dynamo = getCloudService(cred, config) 
 
      tableName="YearlyProductCatalog" 
 
      // list all backups 
      listBackupsStruct={ 
        "BackupType": "ALL", 
        "Limit":20, 
        "TableName":"#tableName#" 
      } 
      backupResponse=dynamo.listBackups(listBackupsStruct) 
      //writeDump(backupResponse.BackupSummaries[1].BackupArn) 
 
      // restore table from backup 
      myBackupArn=backupResponse.BackupSummaries[1].BackupArn 
      myTargetTableName="myNewTargetTable" 
      restoreTableFromBackupStruct = { 
        "BackupArn": myBackupArn, 
        "TargetTableName": "#myTargetTableName#" 
      } 
 
      restoreTableResponse=dynamo.restoreTableFromBackup(restoreTableFromBackupStruct) 
      try{ 
        if ( 
            ((restoreTableResponse.TableDescription.RestoreSummary.RestoreInProgress==TRUE) OR 
            (restoreTableResponse.TableDescription.RestoreSummary.RestoreInProgress=="YES")) AND 
            (restoreTableResponse.TableDescription.TableStatus=="CREATING") 
           ) 
          { 
            writeOutput("Successfully restored the table.") 
          }   
          else 
          { 
            writeOutput("Failed to restore the table.") 
          }   
       } 
      catch (any e){ 
        writeDump(e) 
      } 
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page