Menu
Amazon ElastiCache
User Guide (API Version 2015-02-02)

Taking Manual Backups

In addition to automatic backups, you can create a manual backup at any time. Unlike automatic backups, which are automatically deleted after a specified retention period, manual backups do not have a retention period after which they are automatically deleted. You must manually delete any manual backup. Even if you delete a cluster or node, any manual backups from that cluster or node are retained. If you no longer want to keep a manual backup, you must explicitly delete it yourself.

Manual backups are useful for testing and archiving. For example, suppose that you've developed a set of baseline data for testing purposes. You can create a manual backup of the data and restore it whenever you want. After you test an application that modifies the data, you can reset the data by creating a new cluster and restoring from your baseline backup. When the cluster is ready, you can test your applications against the baseline data again—and repeat this process as often as needed.

In addition to directly creating a manual backup, you can create a manual backup in one of the following ways:

  • Copying a Backup It does not matter whether the source backup was created automatically or manually.

  • Taking a Final Backup Create a backup immediately before deleting a cluster or node.

There is a limit on the rate of manual backup creation: During any contiguous 24-hour period, you can create no more than 20 manual backups per node. Thus a 4-node Redis (cluster mode disabled) cluster can take 80 manual backups in any contiguous 24-hour period - 4 nodes times 20 backups per node.

You can create a manual backup of a node using the ElastiCache console, the AWS CLI, or the ElastiCache API.

Creating a Manual Backup (Console)

To create a backup of a cluster (console)

  1. Sign in to the AWS Management Console and open the ElastiCache console at https://console.aws.amazon.com/elasticache/.

  2. From the left navigation pane, choose Redis.

    The Redis clusters screen appears.

  3. Choose the box to the left of the name of the Redis cluster you want to back up.

  4. Choose Backup.

  5. Complete the Create Backup dialog box.

    1. If you are backing up a Redis (cluster mode disabled) cluster with read replicas, from the Resource Name list, choose the node you want to use for your backup source.

    2. Type in a name for your backup in the Backup Name box.

      Cluster naming constraints

      • Must contain from 1 to 20 alphanumeric characters or hyphens.

      • Must begin with a letter.

      • Cannot contain two consecutive hyphens.

      • Cannot end with a hyphen.

  6. Choose Create Backup.

    The status of the cluster changes to snapshotting. When the status returns to available the backup is complete.

Creating a Manual Backup (AWS CLI)

To create a manual backup of a cluster using the AWS CLI, use the create-snapshot AWS CLI operation with the following parameters:

  • --cache-cluster-id – Name of the Redis (cluster mode disabled) cluster with no replicas to use as the source for the backup. Use this parameter when backing up a Redis (cluster mode disabled) cluster.

    Important

    The value of this parameter must be a specific node in the Redis (cluster mode disabled) cluster. If there are no read replicas, the value is name of the cluster, e.g., myCluster. If there are read replicas, the value is the name of one of the nodes, either the Primary or a Read-Replica, e.g., myCluster-001 or myCluster-002.

  • --replication-group-id – Name of the Redis (cluster mode enabled) cluster (CLI/API: a replication group) to use as the source for the backup. Use this parameter when backing up a Redis (cluster mode enabled) cluster.

     

  • --snapshot-name – Name of the snapshot to be created.

    Cluster naming constraints

    • Must contain from 1 to 20 alphanumeric characters or hyphens.

    • Must begin with a letter.

    • Cannot contain two consecutive hyphens.

    • Cannot end with a hyphen.

Example 1: Backing Up a Redis (cluster mode disabled) Cluster That Has No Read Replicas

The following AWS CLI operation creates the backup bkup-20150515 from the Redis (cluster mode disabled) cluster myNonClusteredRedis that has no read replicas.

For Linux, macOS, or Unix:

Copy
aws elasticache create-snapshot \ --cache-cluster-id myNonClusteredRedis \ --snapshot-name bkup-20150515

For Windows:

Copy
aws elasticache create-snapshot ^ --cache-cluster-id myNonClusteredRedis ^ --snapshot-name bkup-20150515

Example 2: Backing Up a Redis (cluster mode disabled) Cluster with Read Replicas

The following AWS CLI operation creates the backup bkup-20150515 from the Redis (cluster mode disabled) cluster myNonClusteredRedis which has one or more read replicas.

For Linux, macOS, or Unix:

Copy
aws elasticache create-snapshot \ --cache-cluster-id myNonClusteredRedis-001 \ --snapshot-name bkup-20150515

For Windows:

Copy
aws elasticache create-snapshot ^ --cache-cluster-id myNonClusteredRedis-001 ^ --snapshot-name bkup-20150515

Example Output: Backing Up a Redis (cluster mode disabled) Cluster

Output from the operation will look something like the following.

{
    "Snapshot": {
        "Engine": "redis", 
        "CacheParameterGroupName": "default.redis3.2", 
        "VpcId": "vpc-91280df6", 
        "CacheClusterId": "myNonClusteredRedis-001", 
        "SnapshotRetentionLimit": 0, 
        "NumCacheNodes": 1, 
        "SnapshotName": "bkup-20150515", 
        "CacheClusterCreateTime": "2017-01-12T18:59:48.048Z", 
        "AutoMinorVersionUpgrade": true, 
        "PreferredAvailabilityZone": "us-east-1c", 
        "SnapshotStatus": "creating", 
        "SnapshotSource": "manual", 
        "SnapshotWindow": "08:30-09:30", 
        "EngineVersion": "3.2.4", 
        "NodeSnapshots": [
            {
                "CacheSize": "", 
                "CacheNodeId": "0001", 
                "CacheNodeCreateTime": "2017-01-12T18:59:48.048Z"
            }
        ], 
        "CacheSubnetGroupName": "default", 
        "Port": 6379, 
        "PreferredMaintenanceWindow": "wed:07:30-wed:08:30", 
        "CacheNodeType": "cache.m3.2xlarge"
    }
}

Example 3: Backing Up a Redis (cluster mode enabled) Cluster

The following AWS CLI operation creates the backup bkup-20150515 from the Redis (cluster mode enabled) cluster myClusteredRedis. Note the use of --replication-group-id instead of --cache-cluster-id to identify the source.

For Linux, macOS, or Unix:

Copy
aws elasticache create-snapshot \ --replication-group-id myClusteredRedis \ --snapshot-name bkup-20150515

For Windows:

Copy
aws elasticache create-snapshot ^ --replication-group-id myClusteredRedis ^ --snapshot-name bkup-20150515

Example Output: Backing Up a Redis (cluster mode enabled) Cluster

Output from this operation will look something like the following.

{
    "Snapshot": {
        "Engine": "redis", 
        "CacheParameterGroupName": "default.redis3.2.cluster.on", 
        "VpcId": "vpc-91280df6", 
        "NodeSnapshots": [
            {
                "CacheSize": "", 
                "NodeGroupId": "0001"
            }, 
            {
                "CacheSize": "", 
                "NodeGroupId": "0002"
            }
        ], 
        "NumNodeGroups": 2, 
        "SnapshotName": "bkup-20150515", 
        "ReplicationGroupId": "myClusteredRedis", 
        "AutoMinorVersionUpgrade": true, 
        "SnapshotRetentionLimit": 1, 
        "AutomaticFailover": "enabled", 
        "SnapshotStatus": "creating", 
        "SnapshotSource": "manual", 
        "SnapshotWindow": "10:00-11:00", 
        "EngineVersion": "3.2.4", 
        "CacheSubnetGroupName": "default", 
        "ReplicationGroupDescription": "2 shards 2 nodes each", 
        "Port": 6379, 
        "PreferredMaintenanceWindow": "sat:03:30-sat:04:30", 
        "CacheNodeType": "cache.r3.large"
    }
}

For more information, see create-snapshot in the AWS Command Line Interface Reference.

Creating a Manual Backup (ElastiCache API)

To create a manual backup of a cluster using the ElastiCache API, use the CreateSnapshot ElastiCache API operation with the following parameters:

  • CacheClusterId – Name of the Redis (cluster mode disabled) cluster with no replicas to use as the source for the backup. Use this parameter when backing up a Redis (cluster mode disabled) cluster.

    Important

    The value of this parameter must be a specific node in the Redis (cluster mode disabled) cluster. If there are no read replicas, the value is the name of the cluster, e.g., myCluster. If there are read replicas, the value is the name of one of the nodes, either the Primary or one of the Read-Replicas, e.g., myCluster-001 or myCluster-002.

  • ReplicationGroupId – Name of the Redis (cluster mode enabled) cluster (for the CLI or API, the replication group) to use as the source for the backup. Use this parameter when backing up a Redis (cluster mode enabled) cluster.

  • SnapshotName – Name of the backup to be created.

    Cluster naming constraints

    • Must contain from 1 to 20 alphanumeric characters or hyphens.

    • Must begin with a letter.

    • Cannot contain two consecutive hyphens.

    • Cannot end with a hyphen.

Example 1: Backing Up a Redis (cluster mode disabled) Cluster That Has No Read Replicas

The following ElastiCache API operation creates the backup bkup-20150515 from the Redis (cluster mode disabled) cluster myNonClusteredRedis that has no read replicas.

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateSnapshot &CacheClusterId=myNonClusteredRedis &SnapshotName=bkup-20150515 &Version=2015-02-02 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>

Example 2: Backing Up a Redis (cluster mode disabled) Cluster with Read Replicas

The following ElastiCache API operation creates the backup bkup-20150515 from the Redis (cluster mode disabled) cluster myNonClusteredRedis which has one or more read replicas.

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateSnapshot &CacheClusterId=myNonClusteredRedis-001 &SnapshotName=bkup-20150515 &Version=2015-02-02 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>

Example 3: Backing Up a Redis (cluster mode enabled) Cluster

The following ElastiCache API operation creates the backup bkup-20150515 from the Redis (cluster mode enabled) cluster myClusteredRedis. Note the use of ReplicationGroupId instead of CacheClusterId to identify the source.

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateSnapshot &ReplicationGroupId=myClusteredRedis &SnapshotName=bkup-20150515 &Version=2015-02-02 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>

For more information, see CreateSnapshot in the Amazon ElastiCache API Reference.