User Tools

Site Tools


ubuntu_upgrade_pg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ubuntu_upgrade_pg [2019/01/14 22:40]
ian
ubuntu_upgrade_pg [2020/02/13 22:55]
Line 1: Line 1:
-1. Create a snapshot with XenServer 
- 
-Stop the database to make sure snapshot is consistent. 
-<code> 
-# service postgresql stop 
- * Stopping PostgreSQL 9.3 database server 
-   ...done. 
-</code> 
- 
-<code> 
-# xe vm-snapshot new-name-label="Pre PG 9.4 install" vm=exampleVMname 
-26441bbe-9e47-5590-a93f-5b3cd2ddf9b7 
-</code> 
- 
-2. Install the PGDG repo 
- 
-<code> 
-# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 
- 
-# apt-get update 
-</code> 
- 
-3. Install the PGDG postgresql upgrade 
- 
-<code> 
-# apt install postgresql-9.4 
-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: 
-  postgresql-9.4 postgresql-client-9.4 postgresql-contrib-9.4 
-0 upgraded, 3 newly installed, 0 to remove and 115 not upgraded. 
-Need to get 0 B/5,281 kB of archives. 
-After this operation, 24.8 MB of additional disk space will be used. 
-Do you want to continue? [Y/n] y 
-</code> 
- 
-4. Remove the new PG server empty "cluster" 
- 
-<code> 
-# pg_dropcluster --stop 9.4 main 
-</code> 
- 
-5. Perform an upgrade which does a binary copy of the existing database 
- 
-<code> 
- sudo -u postgres pg_dropcluster -v 9.4 9.3 main 
-Stopping old cluster... 
-Disabling connections to the old cluster during upgrade... 
-Restarting old cluster with restricted connections... 
-Creating new PostgreSQL cluster 9.4/main ... 
-</code> 
- 
-6. Remove the old postgresql 9.3 (Ubuntu) packages 
- 
-<code> 
-# apt-get remove postgresql\*-9.3 
-</code> 
- 
-<code> 
-# apt-get autoremove 
-</code> 
  
ubuntu_upgrade_pg.txt ยท Last modified: 2020/02/13 22:55 (external edit)

free spam filter