All Products
Search
Document Center

ApsaraDB RDS:UpgradeDBInstanceMajorVersion

Last Updated:Apr 17, 2024

Initiates a task to upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.

Operation description

Supported database engine

PostgreSQL

References

Fees are generated if the call is successful. Before you call this operation, read the following documentation and make sure that you fully understand the billing rules, prerequisites, and impacts of this operation.

Upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rds:UpgradeDBInstanceMajorVersionWrite
  • DBInstance
    acs:rds:*:{#accountId}:dbinstance/{#DBInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceClassstringNo

The instance type of the new instance. The CPU and memory specifications of the new instance must be higher than or equal to the CPU and memory specifications of the original instance.

For example, if the instance type of the original instance is pg.n2.small.2c, which provides 1 core and 2 GB of memory, the instance type of the new instance can be pg.n2.medium.2c, which provides 2 cores and 4 GB of memory.

Note For more information about instance types in ApsaraDB RDS for PostgreSQL, see Primary ApsaraDB RDS for PostgreSQL instance types.
pg.n2.medium.2c
DBInstanceStorageintegerNo

The storage capacity of the new instance.

Unit: GB

Valid values:

  • Valid values if you use enhanced SSDs (ESSDs) of performance level 1 (PL1): 20 to 3200
  • Valid values if you use ESSDs of PL2: 500 to 3200
  • Valid values if you use ESSDs of PL3: 1500 to 3200
Note If the original instance uses local disks, you can reduce the storage capacity of the instance when you upgrade the major engine version of the instance. For more information about the minimum available storage capacity, see Upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.
20
PayTypestringYes

The billing method. Set the value to Postpaid.

Note For more information about how to change the billing method of an instance after the upgrade, see Change the billing method of an instance from pay-as-you-go to subscription.
Postpaid
InstanceNetworkTypestringNo

The network type of the new instance. Set the value to VPC. The major engine version upgrade feature is supported only for instances that reside in VPCs.

If the original instance resides in the classic network, you must migrate the instance to a VPC before you call this operation. For more information about how to view or change the network type of an instance, see Change the network type of an ApsaraDB RDS for PostgreSQL instance.

VPC
SwitchTimeModestringNo

The switchover time. This parameter is used together with SwitchOver. This parameter is available only when SwitchOver is set to true.

Valid values:

  • Immediate: The settings immediately take effect.
  • MaintainTime: The settings take effect during the maintenance window of the instance. You can call the ModifyDBInstanceMaintainTime operation to change the maintenance window of an instance.
Immediate
SwitchTimestringNo

A reserved parameter. You do not need to specify this parameter.

2021-07-10T13:15:12Z
SwitchOverstringNo

Specifies whether the system automatically switches your workloads over to the new instance after data is migrated to the new instance.

Valid values:

  • true
  • false Before you perform an upgrade, we recommend that you set this parameter to false to test whether the new major engine version is compatible with your workloads.
Note
  • If you set this parameter to true, you must take note of the following information:
  • After the switchover is complete, you cannot roll your workloads back to the original instance. Proceed with caution.
  • During the switchover, the original instance processes only read requests. We recommend that you perform the switchover during off-peak hours.
  • If read-only instances are attached to the original instance, you can set this parameter only to false. In this case, the read-only instances that are attached to the original instance cannot be cloned. After the upgrade is complete, you must create read-only instances for the new instance.
  • If you set this parameter to false, you must take note of the following information:
  • The data migration does not interrupt your workloads on the original instance.
  • After data is migrated to the new instance, you must update the endpoint configuration on your application. This update requires you to replace the endpoint of the original instance with the endpoint of the new instance. For more information about how to view the endpoint of an instance, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance.
  • false
    CollectStatModestringNo

    The time at which the system collects the statistics of the new instance. Valid values:

    • Before: ApsaraDB RDS collects the statistics of the new instance before the switchover to ensure service stability. If the original instance contains a large amount of data, the upgrade may require a long period of time.
    • After: ApsaraDB RDS collects the statistics of the new instance after the switchover to accelerate the upgrade. If you access tables for which no statistics are generated, the execution plans that you specify may be inaccurate. In addition, your database service may be unavailable during peak hours.
    Note If you set SwitchOver to false, the value Before of this parameter specifies that ApsaraDB RDS collects the statistics of the new instance before the new instance starts to process read and write requests, and the value After of this parameter specifies that ApsaraDB RDS collects the statistics of the new instance after the new instance starts to process read and write requests.
    After
    TargetMajorVersionstringNo

    The major engine version of the new instance. The value of this parameter must be the major engine version on which an upgrade check is performed.

    Note You can call the UpgradeDBInstanceMajorVersionPrecheck operation to perform an upgrade check.
    13.0
    DBInstanceIdstringNo

    The ID of the original instance.

    pgm-bp1gm3yh0ht1****
    VPCIdstringNo

    The VPC ID. You can call the DescribeDBInstanceAttribute operation to query the VPC ID.

    vpc-bp1opxu1zkhn00gzv****
    VSwitchIdstringNo
    • If the original instance runs RDS Basic Edition, you must enter the vSwitch ID of the new instance.
    • If the original instance runs RDS High-availability Edition, you must enter the vSwitch ID of the new instance and the vSwitch ID of the secondary instance of the new instance. Separate the vSwitch IDs with commas (,).
    Note The vSwitches that you specify must reside in the same zone as the original instance. You can call the DescribeVSwitches operation to query the vSwitch IDs.
    vsw-bp10aqj6o4lclxdrm****,vsw-bp10aqj6o4lclxdrm****
    PrivateIpAddressstringNo

    The internal IP address of the new instance. You do not need to specify this parameter. The system automatically assigns an internal IP address based on the values of the VPCId and vSwitchId parameters.

    172.16.XX.XX
    UsedTimestringNo

    A reserved parameter. You do not need to specify this parameter.

    1
    PeriodstringNo

    A reserved parameter. You do not need to specify this parameter.

    Month
    DBInstanceStorageTypestringNo

    The storage type of the new instance.

    Valid values:

    • cloud_ssd: standard SSDs
    • cloud_essd: ESSD of PL1
    • cloud_essd2: ESSD of PL2
    • cloud_essd3: ESSD of PL3

    The major engine version upgrade feature is based on cloud disk snapshots. You can select a storage type based on the following conditions:

    • If the original instance uses standard SSDs, you can set this parameter to cloud_ssd.
    • If the original instance uses ESSDs, you can set this parameter to cloud_essd, cloud_essd2, or cloud_essd3.
    • If the original instance uses local disks, you can set this parameter to cloud_essd, cloud_essd2, or cloud_essd3.
    cloud_essd
    ZoneIdstringNo

    The zone ID of the new instance. You can call the DescribeRegions operation to query the zone ID.

    You can select a zone that is different from the zone of the original instance but belongs to the region in which the original instance resides.

    cn-hangzhou-h
    ZoneIdSlave1stringNo

    The zone ID of the secondary instance for the new instance. You can specify this parameter only when the original instance runs RDS High-availability Edition.

    You can select a zone that is different from the zone of the original instance but belongs to the region in which the original instance resides.

    You can call the DescribeRegions operation to query the zone ID.

    cn-hangzhou-h
    ZoneIdSlave2stringNo

    A reserved parameter. You do not need to specify this parameter.

    cn-hangzhou-h

    Response parameters

    ParameterTypeDescriptionExample
    object

    The response parameters.

    DBInstanceIdstring

    The ID of the instance.

    pgm-bp1gm3yh0ht1****
    RequestIdstring

    The ID of the request.

    006729E5-2A33-5955-89E3-651D3F44EBE6
    OrderIdstring

    The ID of the order.

    21128667463****
    TaskIdlong

    A reserved parameter.

    416980000

    Examples

    Sample success responses

    JSONformat

    {
      "DBInstanceId": "pgm-bp1gm3yh0ht1****",
      "RequestId": "006729E5-2A33-5955-89E3-651D3F44EBE6",
      "OrderId": "21128667463****",
      "TaskId": 416980000
    }

    Error codes

    HTTP status codeError codeError messageDescription
    400InvalidUpgradePrecheckResultThe upgrade precheck failed. No successful precheck task found in the past 7 daysThe upgrade precheck failed. No successful precheck task is found within the last 7 days.
    400TargetEngineVersion.Parameters.NotFoundtargetEngineVersion is missing in the request.The targetEngineVersion is missing in the request.
    400InvalidDBInstanceStorageTypeThe specified DBInstanceStorageType is invalid.The specified DBInstanceStorageType parameter is invalid.
    400InvalidInstanceNetworkTypeThe specified InstanceNetworkType is invalid.The specified InstanceNetworkType is invalid.
    400InvalidVPCIdThe specified VPCId is invalid.The specified VPCId parameter is invalid.
    400InvalidDedicatedHostGroupIdThe specified DedicatedHostGroupId is invalid.The specified DedicatedHostGroupId parameter is invalid.
    400InvalidPayTypeThe specified PayType is invalid.The specified PayType is invalid.
    400InvalidEngineVersionThe specified EngineVersion is invalid.The specified EngineVersion parameter is invalid.
    400InvalidDBInstanceStorageThe specified DBInstanceStorage is invalid.The specified DBInstanceStorage parameter is invalid.
    400InvalidSwitchOverThe specified SwitchOver is invalid.The specified SwitchOver parameter is invalid.
    400PrimaryInstanceWithReadonlyNotSupportThe specified primary instance with the read-only instance does not support the operation.This operation is not supported for the specified primary instance that has a read-only instance.
    400InvalidSwitchTimeModeThe specified SwitchTimeMode is invalid.The specified SwitchTimeMode parameter is invalid.
    400InvalidSwitchTimeThe specified SwitchTime is invalid.The specified SwitchTime parameter is invalid.
    400InvalidCollectStatsThe specified CollectStats is invalid.The specified CollectStats parameter is invalid.
    400IncorrectDBInstanceStateThe current instance state does not support this operation.The operation is not supported. The RDS instance is not in a ready state.
    400InvalidDBinstanceClass.ValueNotSupportedThe specified parameter DBinstanceClass is invalid.The specified parameter DBinstanceClass is invalid.
    400Order.ComboInstanceNotAllowOperateA package instance is not allowed to operate independently.A package instance is not allowed to operate independently.
    400Price.PricingPlanResultNotFoundPricing plan price result not found.Pricing plan price result not found.
    400Order.NoRealNameAuthenticationYou have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.You have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.
    400InsufficientAvailableQuotaYour account quota limit is less than 0, please recharge before trying to purchase.Your account available limit is less than 0, please recharge before trying to purchase.
    400CommodityServiceCalling.ExceptionFailed to call commodity service.Failed to call commodity service return.
    400RegionDissolvedEOMDear customer, Alibaba Cloud plans to optimize and adjust the current region. Cloud services in this region will cease operations. You are currently unable to operate new purchase orders. Thank you for your understanding and support.Hello, Alibaba Cloud plans to optimize and adjust the current region. Cloud services in this region will stop operating. In order to ensure your business continuity and smooth transition of data migration, you are currently unable to operate new purchase orders. Thank you for your understanding and support.
    400Commodity.InvalidComponentThe module you purchased is not legal, please buy it again.The module you purchased is not legal, please buy it again.
    400RegionEndTimeDissolvedIndiaCloud services in the India (Mumbai) region will be discontinued. Set the validity date to July 15, 2024 or earlier than July 15, 2024.Cloud services in the India (Mumbai) region will be discontinued. Set the validity date to July 15, 2024 or earlier than July 15, 2024.
    400RegionEndTimeDissolvedAustraliaCloud services in the Australia (Sydney) region will be discontinued. Set the validity date to September 30, 2024 or earlier than September 30, 2024.Cloud services in the Australia (Sydney) region will be discontinued. Set the validity date to September 30, 2024 or earlier than September 30, 2024.
    400Price.CommoditySysCommodity system call exception.Commodity system call exception.
    400Pay.InsufficientBalanceInsufficient available balance.Insufficient available balance.
    400Order.PeriodInvalidThere is a problem with the period you selected, please choose again.There is a problem with the period you selected, please choose again.
    400pay.noCreditCardAccount not bound to credit card.-
    400Order.InstHasUnpaidOrderThere is an unpaid order for the service you have purchased. Please pay or void it before placing the order.There is an unpaid order for the service you have purchased. Please pay or void it before placing the order.
    400noAvailablePaymentMethodNo payment method is specified for your account. We recommend that you add a payment method.-
    400BasicInfoUncompletedYour information is incomplete. Complete your information before the operation.Your basic information is not complete, please complete your basic information before operation.
    400Risk.RiskControlRejectionYour account is abnormal, please contact customer service for details.Your account is abnormal, please contact customer service for details.
    403OrderStatus.UnPaidThe specified db instance has unpaid order.The instance has an unpaid order. Please pay first and try again.
    404InvalidDBInstanceName.NotFoundThe database instance does not exist.The name of the RDS instance cannot be found. Check the name of the RDS instance.
    404IncorrectDBInstanceLockModeCurrent DB instance lock mode does not support this operation.The operation failed. The RDS instance is locked.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    No change history