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:26] 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 26: | Line 31: | ||
| # aptitude install postgresql-9.4 | # aptitude install postgresql-9.4 | ||
| The following NEW packages will be installed: | The following NEW packages will be installed: | ||
| - | postgresql-9.4 postgresql-client-9.4{a} postgresql-client-common{a} postgresql-common{a} postgresql-contrib-9.4{a} | + | postgresql-9.4 postgresql-client-9.4{a} postgresql-contrib-9.4{a} |
| - | 0 packages upgraded, | + | 0 packages upgraded, |
| - | Need to get 0 B/5,588 kB of archives. After unpacking 25.5 MB will be used. | + | Need to get 0 B/5,281 kB of archiv |
| - | Do you want to continue? [Y/n/?] y | + | |
| </ | </ | ||
| Line 35: | Line 39: | ||
| < | < | ||
| - | # sudo -u postgres pg_dropcluster 9.4 main | + | # sudo -u postgres pg_dropcluster |
| </ | </ | ||
| Line 41: | Line 45: | ||
| < | < | ||
| - | # sudo -u postgres | + | # service postgresql stop |
| - | Stopping old cluster... | + | |
| + | # pg_upgradecluster -v 9.4 9.3 main | ||
| 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 51: | Line 66: | ||
| < | < | ||
| - | # apt-get remove postgresql\*-9.3 | + | # apt-get remove postgresql |
| </ | </ | ||
| Line 57: | 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 | ||
| + | </ | ||
| + | |||