Re: Switching from 9.1 to 9.5 on Ubuntu 16.04 - Mailing list pgsql-novice

From Fabio Pardi
Subject Re: Switching from 9.1 to 9.5 on Ubuntu 16.04
Date
Msg-id 3598cb12-8d6f-4ff2-a855-1c3b9e3aaf66@portavita.eu
Whole thread Raw
In response to Switching from 9.1 to 9.5 on Ubuntu 16.04  (Mike Dewhirst <miked@dewhirst.com.au>)
List pgsql-novice

Hi Mike,

best (and must) for you and your customers would be if you could test on a non production env. (and obscure IP addresses from your messages)


In order to do not lose data I would do the following steps instead:

1. Block access to database so that nobody except you can read or write.

2. dump db 9.1

3. stop db 9.1

4 start db 9.5

5. import dump to 9.5

6. restore access


Note that you might need to change your postgresql.conf file because of the introduction of 'max_wal_size' from 9.5 on.

Also note that in your proposed procedure here below, you might lose new data inserted between 1 and 2 because the dump is a snapshot taken at the time you initiate the process: new data that comes in after that, is not included in it.

Also something to keep in mind is the size of the dump. if is very big, you might want to go through the pg_ugrade procedure in order to keep downtime window smaller.

regards,

fabio pardi



On 20/08/18 13:21, Mike Dewhirst wrote:
Sorry if this has been covered before. If so I'd appreciate a heads up.

Could someone please refer me to the appropriate documentation for disabling 9.1 and enabling 9.5 on Ubuntu 16.04?

I have a production database running on 9.1 and can dump and reload without problem. I have tried the following ...

1. Dump from 9.1

2. sudo service postgresql stop
(which returned without error)

3. Adjust (9.1) postgresql.conf port entry from 5432 to 5431

4. Adjust (9.5) postgresql.conf port entry to 5432

5 sudo service postgresql start (which returned without error)

When trying to createdb I'm getting the following error ...

createdb: could not connect to database template1: could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "pq4" (203.34.166.57) and accepting
        TCP/IP connections on port 5432?

For the moment I have restored the conf files, restarted and we are back in production.

Any hints appreciated

Thanks

Mike

pgsql-novice by date:

Previous
From: Mike Dewhirst
Date:
Subject: Switching from 9.1 to 9.5 on Ubuntu 16.04
Next
From: Fabio Pardi
Date:
Subject: Re: Switching from 9.1 to 9.5 on Ubuntu 16.04