This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
ubuntu_upgrade_pg [2019/01/14 22:40] ian |
ubuntu_upgrade_pg [2020/02/13 22:55] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Upgrade of PostgreSQL and Ubuntu upgrade ====== | ||
| + | |||
| + | |||
| 1. Create a snapshot with XenServer | 1. Create a snapshot with XenServer | ||
| Line 7: | Line 10: | ||
| | | ||
| </ | </ | ||
| + | postgresql | ||
| < | < | ||
| - | # xe vm-snapshot new-name-label=" | + | xenserver# xe vm-snapshot new-name-label=" |
| 26441bbe-9e47-5590-a93f-5b3cd2ddf9b7 | 26441bbe-9e47-5590-a93f-5b3cd2ddf9b7 | ||
| </ | </ | ||
| Line 17: | Line 20: | ||
| < | < | ||
| # sudo sh -c 'echo "deb http:// | # sudo sh -c 'echo "deb http:// | ||
| + | |||
| + | # curl https:// | ||
| # apt-get update | # apt-get update | ||
| Line 24: | Line 29: | ||
| < | < | ||
| - | # apt install postgresql-9.4 | + | # aptitude |
| - | Reading package lists... Done | + | |
| - | Building dependency tree | + | |
| - | Reading state information... Done | + | |
| - | The following extra packages will be installed: | + | |
| - | postgresql-client-9.4 postgresql-contrib-9.4 | + | |
| - | Suggested packages: | + | |
| - | locales-all postgresql-doc-9.4 libdbd-pg-perl | + | |
| The following NEW packages will be installed: | The following NEW packages will be installed: | ||
| - | postgresql-9.4 postgresql-client-9.4 postgresql-contrib-9.4 | + | postgresql-9.4 postgresql-client-9.4{a} postgresql-contrib-9.4{a} |
| - | 0 upgraded, 3 newly installed, 0 to remove and 115 not upgraded. | + | 0 packages |
| - | Need to get 0 B/5,281 kB of archives. | + | Need to get 0 B/5,281 kB of archiv |
| - | After this operation, 24.8 MB of additional disk space will be used. | + | |
| - | Do you want to continue? [Y/n] y | + | |
| </ | </ | ||
| Line 43: | Line 39: | ||
| < | < | ||
| - | # pg_dropcluster --stop 9.4 main | + | # sudo -u postgres |
| </ | </ | ||
| Line 49: | Line 45: | ||
| < | < | ||
| - | sudo -u postgres pg_dropcluster | + | # service postgresql stop |
| - | Stopping old cluster... | + | |
| + | # pg_upgradecluster | ||
| Disabling connections to the old cluster during upgrade... | Disabling connections to the old cluster during upgrade... | ||
| Restarting old cluster with restricted connections... | Restarting old cluster with restricted connections... | ||
| - | Creating new PostgreSQL | + | Creating new cluster 9.4/main ... |
| + | config / | ||
| + | data / | ||
| + | locale en_CA.UTF-8 | ||
| + | port | ||
| + | Disabling connections to the new cluster during upgrade... | ||
| + | ... | ||
| + | Success. Please check that the upgraded cluster works. If it does, | ||
| + | you can remove the old cluster with | ||
| + | |||
| + | pg_dropcluster 9.3 main | ||
| </ | </ | ||
| Line 59: | Line 66: | ||
| < | < | ||
| - | # apt-get remove postgresql\*-9.3 | + | # apt-get remove postgresql |
| </ | </ | ||
| Line 65: | Line 72: | ||
| # apt-get autoremove | # apt-get autoremove | ||
| </ | </ | ||
| + | |||
| + | 7. Proceed with the Ubuntu upgrade | ||
| + | |||
| + | < | ||
| + | # apt-get dist-upgrade | ||
| + | |||
| + | # do-release-upgrade | ||
| + | </ | ||
| + | |||
| + | And restore the PGDG repo | ||
| + | |||
| + | < | ||
| + | # sudo sh -c 'echo "deb http:// | ||
| + | |||
| + | # apt update | ||
| + | |||
| + | # apt full-upgrade | ||
| + | </ | ||
| + | |||