I am looking to upgrade from PostgreSQL to Aurora PostgreSQL and running into an issue when trying to test an upgrade in my CFT I specify the EngineVersion for my DB Cluster as 9.6.11 but I can’t update that to 9.6.12 as it requires a replacement of the cluster stack. If i deploy my stack out without the EngineVersion for the Cluster then it defaults to 9.6.9 which is below the version I want PostgreSQL at. I was able to upgrade the Cluster from 9.6.11 to 9.6.12 via the CLI but when i updated the EngineVersion in the CFT for the cluster to 9.6.12 it still wanted to create a new Cluster Stack even though the version was changed to 9.6.12 via the CLI. Is there a good way to get around this using CloudFormation?
This is an old question, but I'm running into the same problem while trying to upgrade from Aurora Postgres 9.6.11 to 10.11. CloudFormation wants to replace the cluster which wipes out the database. I think what we need to do is the following:
Use Console or CLI to update the Engine version
Snapshot the database
Delete the CloudFormation stack
Rebuild the CloudFormation stack restoring from the Snapshot taken in step 2
This seems a little wonky to me, but I'm not sure how else to update the engine version and also get CloudFormation in sync with the resources. Using the Console or CLI to update the engine version will cause drift in the template, so the only recourse is to delete the stack and recreate it.
Related
Azure Postgres Single server version is 11. Is it possible to upgrade it to 13+ version using dump and restore as mentioned here:
https://learn.microsoft.com/en-us/azure/postgresql/how-to-upgrade-using-dump-and-restore
It should still remain Single Server.
Yes, you can.
The document you shared is Microsoft's official and therefore there is no doubt that you can upgrade it to any higher version using dump and restore.
Just take care of the below mentioned points:
You can upgrade your PostgreSQL server deployed in Azure Database for PostgreSQL by migrating your databases to a higher major version server using following methods.
Offline method using PostgreSQL pg_dump and pg_restore which incurs downtime for migrating the data.
Online method using Database Migration Service (DMS). This method provides a reduced downtime migration and keeps the target database in-sync with the source and you can choose when to cut-over. However, there are few prerequisites and restrictions to be addressed for using DMS.
The following table provides some recommendations based on database sizes and scenarios.
Choose the right approach based on your database configuration and it should be done without any issue.
To upgrade using pg_dump and pg_restore, you can refer Migrate your PostgreSQL database by using dump and restore.
It is not possible.
In the document, prerequisites states:
A source PostgreSQL database server running a lower version of the
engine that you want to upgrade. A target PostgreSQL database server
with the desired major version Azure Database for PostgreSQL server -
Single Server or Azure Database for PostgreSQL - Flexible Server.
The question asks about upgrading target.
Good day. I just finished upgrading my AWS RDS database engine from 9.6.22 to 10.17. I used these steps to make the upgrade using the AWS Console:
Create snapshot of target database to upgrade
Restore snapshot
Upgrade the restored snapshot's (which is now a new instance) DB Engine version.
After I did all of this, everything seems fine but when I access the database, this warning message appears
WARNING: psql major version 9.6, server major version 10.
Some psql features might not work.
I did not continue on my testing because I want to know what is the meaning of this first. Because I am fairly new in AWS as a whole. Thanks!
The meaning is that just because you are connecting to an upgraded database on some machine run by Amazon, the PostgreSQL installation on your local machine was not magically updated. psql from version 9.6 doesn't know what metadata tables were changed in v10, what features were removed and so on.
It would be a good idea to install a more recent version of PostgreSQL on your machine. By the way, upgrading to v10 was not the smartest move, as that version will go out of support in less than a year. You should upgrade to the latest version that your service provider offers.
The client program psql you are using to connect to the database is from an older version than the database it is connecting to. Some of the introspection features might not work. For example, psql from 9.6 won't know how to do tab completion for commands that were added to the server after 9.6.
This is generally not a major problem for psql (unless the server wants to use SCRAM authentication), but for optimal experience it would be good to install a newer client. Other tools like pg_dimp might not with at all against a server newer than they are.
I am trying to upgrade Aurora RDS Postgres cluster db.r5.xlarge from version 12.7 to 13.3.
I choose Engine version 13.3, default DB cluster parameter group and DB parameter group default.aurora-postgresql13 and choose 'Apply immediately'.
Received error message:
We're sorry, your request to modify DB cluster clone-cluster has failed.
Cannot modify engine version because instance clone-cluster is running on an old configuration.
Apply any pending maintenance actions on the instance before proceeding with the upgrade
There are no any pending maintenance actions showing in AWS RDS console and I have no idea what configuration they mean.
We are on a free basic support plan no so we cannot get help from AWS. Can anyone please suggest if there's a way to upgrade the whole cluster at once?
I had this issue and contacted AWS support. They said it is a known issue for (some, or all) db.t3 instance types. In my case I was using db.t3.medium.
So the workaround is as follows:
Change instance type on the cluster to r5.xlarge or db.r6g.large.
Upgrade to PostgreSQL 13.3
Change instance type back to db.t3.medium.
Just to add to the other great answers, another possible reason for "old configuration" errors is attempting to upgrade from an old minor version.
I was trying to upgrade from Postgres 12.6 directly to 13.3, which is not supported.
Instead, I had to upgrade to 12.7 first and then upgrade to 13.3.
It's written in the docs, but I didn't notice the minor version requirement.
Hit the same issue with upgrade to a major version and here's the undocumented solution I found:
Select an instance from the cluster, and in the actions menu you should see Upgrade Now.
Do this for each instance that is part of the cluster.
Modify the cluster and you should be able to upgrade to any available 13.x version.
Even though it is shown as the same version as the Cluster, the Upgrade now action will run configuration update on the instance itself putting it in maintenance and rebooting it.
This is not correctly documented at the moment, but it is possible to check and resolve (for those of us automating the upgrade process.) The CLI aws rds describe-pending-maintenance-actions sometimes reports the status. If you know ARNs, you can filter on them, or if just a name, this seems to work:
aws rds describe-pending-maintenance-actions --query 'PendingMaintenanceActions[?contains(ResourceIdentifier, `test`)`
The maintenance can be applied programmatically using apply-pending-maintenance-action.
However...
This message also appears to occur when something about the upgrade path is invalid. In my case, I believe the case is as follows:
Source is 9.6.19 Aurora PostgreSQL
Target is 10.18. This fails.
Set target to 10.14 and upgrade occurs
In short, the UI, and other information about what versions of what are compatible is incomplete. I have reported this to AWS and they mostly shrugged, telling me to look at the doc. Pffft.
This one worked for me. In rds, select the server highlighted in the error message, go to "Configuration" and make sure that the "Recommendations" area is empty, otherwise, "Apply Now" the recommendation/s. Once all completed, "Modify" from the Global/Regional Cluster and try to upgrade again.
I am using kOps to perform a manual cluster upgrade (from 1.17 to 1.18) as explained at https://kops.sigs.k8s.io/operations/updates_and_upgrades/#upgrading-kubernetes
I've noticed that kOps does not update the ami-image defined at spec.image at ig nodes, that means after cluster upgrade nodes are going to use the same base OS despite the kubernetes upgrade. But if you install 1.18 from scratch kOps uses the latest image available for that version.
should i update the version and configure it the same as the one kOps would use in case of an installation from scratch?
In 1.18 ami has moved from Debian to Ubuntu, should i take any precautions due to the change of operating system?
if you edit the manifests directly and do "kops update" etc ... then you need to also update the images, another alternative is to let kops do it for you by running "kops upgrade cluster " it will update the remote state and set the correct defaults etc ..
regarding the image change, i don't see any major issues there, what you can do is grab the current ami and do "sort of rollbacks" by replacing the image and updating the cluster ( or applying previous version of the manifest assuming you have s3 revisions on the state )
There was a bug up until kOps 1.18.2 where Ubuntu images were considered "custom" and therefore not upgraded by kops upgrade. See this bug
As of 1.18.2, you should see upgrades for Ubuntu as well.
There is no particular need to take any precaution when switching from Debian to Ubuntu unless you are using kOps hooks that would be Debian. kOps will take care of this change for you.
I am running PostgreSQL 9.3 on Ubuntu 14.04 LTS. I didn't remember creating a cluster but directly went to create database.
Using pg_lsclusters, I found that I have a cluster as following with my db
Ver Cluster Port Status Owner Data directory
9.3 main 5432 online postgres /var/lib/postgresql/9.3/main
I was reading the PostgreSQL documentation but couldn't find relevant info.
I have the following questions:
Does PostgreSQL automatically create default cluster? And if so, is it good practice to use it?
Does PostgreSQL also automatically start the default cluster? I never started but its status is online and I can see it in system-monitor.
Thanks for any clarifications!
You're really asking about "PostgreSQL on Debian or Ubuntu", as it's the packaging and wrapper utilities doing this, not PostgreSQL its self.
See the PostgreSQL help on the Ubuntu community wiki for information. This mostly applies to Debian too, since it uses the same style of packaging for PostgreSQL.
To your specific questions:
Does PostgreSQL automatically create default cluster? And if so, is it good practice to use it?
Strictly pg_wrapper, the Ubuntu/Debian tool that manages PostgreSQL installs, creates it. Yes, it's fine to use it and there's generally not much reason not to.
Does PostgreSQL also automatically start the default cluster?
This depends on your operating system and its PostgreSQL packages, not on PostgreSQL its self. For information on how to configure what starts on Ubuntu, see Boot Howto - Ubuntu Community Wiki.