Aurora PG13 to PG14 Migration:修订间差异

来自linuxsa wiki
跳转到导航 跳转到搜索
Evan留言 | 贡献
Evan留言 | 贡献
第51行: 第51行:
   --db-snapshot-identifier before-pg14-upgrade \
   --db-snapshot-identifier before-pg14-upgrade \
   --region ap-east-1
   --region ap-east-1
步骤 1:停止业务连接(避免写入 PG14)
步骤 2:从 before-pg14-upgrade 快照恢复实例
控制台操作:
    RDS → 快照
    选中升级前的快照
    恢复为新实例(或覆盖原实例)
CLI 回滚命令(你直接用)
aws rds restore-db-instance-from-db-snapshot \
  --db-instance-identifier 你的实例ID \
  --db-snapshot-identifier before-pg14-upgrade \
  --region ap-east-1
步骤 3:恢复完成后 → 版本回到 PG13
恢复出来的实例 完全是 PG13数据、配置、参数全部回到升级前状态。


</pre>
</pre>

2026年4月11日 (六) 11:37的版本

parameter compare

cluster parameter compare

导出生产 PG13 参数,可先  dev env 

aws rds describe-db-cluster-parameters \
  --db-cluster-parameter-group-name <your-prod-pg13-param-group> \
  --query 'Parameters[*].{Name:ParameterName, Value:ParameterValue, Source:Source}' \
  --output text > pg13_params.txt

导出测试环境 PG14 参数
aws rds describe-db-cluster-parameters \
  --db-cluster-parameter-group-name my-aurora-pg14-cluster-params \
  --query 'Parameters[*].{Name:ParameterName, Value:ParameterValue, Source:Source}' \
  --output text > pg14_params.txt

输出格式示例
autovacuum        on      engine-default
log_connections   on      user        ← 这条是你们自定义的
max_connections   NONE    engine-default
shared_buffers    NONE    engine-default


instance parameter compare



直接获取 AWS 官方 RDS PG14 默认全部参数(不需要任何权限)

aws ssm get-parameters-by-path   --path /aws/rds/parameter/postgres14/   --region ap-east-1   --no-sign-request   --output json > pg14-default-parameters.json

回滚方案

能从快照恢复:

    RDS → 快照 → 选中升级前的快照
    恢复为新实例(或覆盖原实例)
    恢复后版本回到 PG13

aws cli
aws rds restore-db-instance-from-db-snapshot \
  --db-instance-identifier YOUR_DB_NAME_RESTORE \
  --db-snapshot-identifier before-pg14-upgrade \
  --region ap-east-1


步骤 1:停止业务连接(避免写入 PG14)
步骤 2:从 before-pg14-upgrade 快照恢复实例
控制台操作:

    RDS → 快照
    选中升级前的快照
    恢复为新实例(或覆盖原实例)

CLI 回滚命令(你直接用)

aws rds restore-db-instance-from-db-snapshot \
  --db-instance-identifier 你的实例ID \
  --db-snapshot-identifier before-pg14-upgrade \
  --region ap-east-1


步骤 3:恢复完成后 → 版本回到 PG13
恢复出来的实例 完全是 PG13数据、配置、参数全部回到升级前状态。