Chapter 61 · Amazon Elasticache
Subchapter 61.22
references/migration/upgrade-patching.mdMarkdown13 KBView on GitHub
Operational runbook for keeping ElastiCache clusters current with engine versions, service updates, and node type changes.
Engine version upgrades are performed in-place with minimal downtime for replication groups running Redis OSS 5.0.6 or higher with Multi-AZ enabled. The cluster is available for reads during the entire upgrade and for writes during most of the upgrade, except during the failover operation which lasts a few seconds. For versions earlier than Redis OSS 5.0.6, you may experience a failover time of 30 to 60 seconds during DNS propagation. Single-node clusters experience primary unavailability during upgrades. Note: pending scale-up operations must complete before an engine upgrade can be applied.
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--engine-version 8.0 \
--apply-immediately \
--region <region>Process (single shard / cluster mode disabled):
Process (multiple shards / cluster mode enabled):
Same in-place mechanism as minor upgrades. Major versions may introduce new features (e.g., vector search in 8.2) and deprecate old behaviors.
Pre-upgrade checklist:
# Take a pre-upgrade snapshot
aws elasticache create-snapshot \
--replication-group-id <cluster-id> \
--snapshot-name pre-upgrade-$(date +%Y%m%d) \
--region <region>
# Upgrade
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--engine-version 8.2 \
--apply-immediately \
--region <region>Valkey is designed as a drop-in replacement for Redis OSS 7. No application code changes required. When upgrading from Redis OSS 5.0.6 and higher, you will experience no downtime. When upgrading from earlier Redis OSS versions than 5.0.6, you may experience a failover time of 30 to 60 seconds during DNS propagation.
# If using the default parameter group:
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--engine valkey \
--engine-version 8.0 \
--apply-immediately \
--region <region>
# If using a custom parameter group, you must also pass a Valkey parameter group:
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--engine valkey \
--engine-version 8.0 \
--cache-parameter-group-name <valkey-param-group> \
--apply-immediately \
--region <region>Prerequisites:
--cache-parameter-group-name).Benefits:
For Valkey 7.2+ and Redis OSS 7.0+ replication groups with automatic failover and at least one replica, you can convert from cluster mode disabled (CMD) to cluster mode enabled (CME) in-place without creating a new cluster. This is a one-way operation — once cluster mode is set to enabled, it cannot be disabled. CME→CMD conversion is not supported.
This is a two-step process:
compatible (allows both CMD and CME clients to connect)enabled (CME only)# Step 1: Enable compatible mode
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--cluster-mode compatible \
--apply-immediately \
--region <region>
# Wait for modification to complete, then:
# Step 2: Enable cluster mode
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--cluster-mode enabled \
--apply-immediately \
--region <region>Prerequisites:
Important: You can revert from compatible back to disabled, but once set to enabled, the change is irreversible. Test in a non-production environment first. For details on auth and ACL considerations during this migration, see auth-migration.md.
| Source Engine | Source Version | Target Engine | Target Version | Method | Downtime |
|---|---|---|---|---|---|
| Redis OSS | 6.x | Redis OSS | 7.x | In-place upgrade | Zero (Multi-AZ) |
| Redis OSS | 7.x | Valkey | 7.2 | In-place engine switch | Zero (Multi-AZ) |
| Valkey | 7.2 | Valkey | 8.0 | In-place upgrade | Zero (Multi-AZ) |
| Valkey | 7.2 | Valkey | 8.2 | In-place upgrade | Zero (Multi-AZ) |
| Valkey | 8.0 | Valkey | 8.2 | In-place upgrade | Zero (Multi-AZ) |
| Redis OSS | 5.x | Redis OSS | 7.x | In-place (direct jump supported) | Zero (Multi-AZ, 5.0.6+); brief failover for older versions |
| Valkey | 7.2 | Redis OSS | 7.1 | In-place rollback | Zero (Multi-AZ) |
| Any | Any newer | Any | Any older | Not supported (except Valkey 7.2 to Redis OSS 7.1) | N/A |
Key rule: Engine version downgrades are generally not supported. You cannot roll back from 8.2 to 7.2 using an in-place operation. However, ElastiCache supports rolling back from Valkey 7.2 to Redis OSS 7.1 as a special case, using the same console, API, or CLI steps as an upgrade. This rollback is performed with zero downtime. Rollback from Valkey 8.0 or higher to Redis OSS is not supported. Always test upgrades in a non-production environment first.
Redis OSS versions 4 and 5 will enter Extended Support on February 1, 2026 (end of standard support: January 31, 2026). Redis OSS v6 will enter Extended Support on February 1, 2027 (end of standard support: January 31, 2027). Running these versions past end of standard support incurs additional charges with escalating yearly premiums. Extended Support is available for up to 3 years. After Extended Support ends, AWS will attempt to upgrade caches still running those versions to a supported version of Valkey; if the upgrade fails, the cache may be deleted. We strongly recommend upgrading to Valkey or Redis OSS v6+ before the end of standard support.
General engine version downgrades are not supported, with one exception: ElastiCache supports rolling back from Valkey 7.2 to Redis OSS 7.1 using the same in-place process as an upgrade, with zero downtime. Requirements for this rollback:
REDISFor all other downgrade scenarios:
ElastiCache periodically releases service updates for security patches, bug fixes, and minor improvements.
Check for available updates:
aws elasticache describe-service-updates \
--service-update-status available \
--region <region>
# Check which clusters need an update
aws elasticache describe-update-actions \
--service-update-name <update-name> \
--update-action-status not-applied \
--region <region>Apply an update:
aws elasticache batch-apply-update-action \
--replication-group-ids <cluster-id-1> <cluster-id-2> \
--service-update-name <update-name> \
--region <region>Some service updates have an auto-apply date. If you do not apply them before that date, AWS applies them during your maintenance window.
Node-based clusters have a configurable weekly maintenance window for auto-applied updates. Serverless caches do not have maintenance windows (updates are applied transparently with zero downtime).
Configure the maintenance window:
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--preferred-maintenance-window "sun:03:00-sun:04:00" \
--region <region>Best practices:
describe-events output after patching to confirm completionServerless caches automatically apply the latest minor and patch software versions transparently, with no downtime and no action required from the operator. There is no maintenance window to configure. However, when a new major version is available, ElastiCache Serverless sends a notification and the operator must choose to upgrade by modifying the cache. Major version upgrades are also performed without downtime.
For supported node type transitions, ElastiCache performs online scaling with zero downtime (Multi-AZ required).
# Check which node types you can scale to
aws elasticache list-allowed-node-type-modifications \
--replication-group-id <cluster-id> \
--region <region>
# Scale up (or down)
aws elasticache modify-replication-group \
--replication-group-id <cluster-id> \
--cache-node-type cache.r7g.xlarge \
--apply-immediately \
--region <region>Process:
Time: depends on data volume. Large datasets (100+ GB) can take 30 minutes or more.
list-allowed-node-type-modifications to check.Serverless caches scale automatically. There is no node type to change. Adjust CacheUsageLimits to control maximum capacity and cost:
aws elasticache modify-serverless-cache \
--serverless-cache-name <name> \
--cache-usage-limits '{
"DataStorage": {"Maximum": 10, "Unit": "GB"},
"ECPUPerSecond": {"Maximum": 15000}
}' \
--region <region>Before any upgrade or patching operation:
python3 scripts/security_audit.py after completion to confirm posture