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 dc8bea1d-c0c3-22b8-1758-7a7c8866d48d@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>)
Responses Re: Switching from 9.1 to 9.5 on Ubuntu 16.04  (Mike Dewhirst <miked@dewhirst.com.au>)
List pgsql-novice

Hi Mike,


please keep the mailing list posted, so maybe other people can help you too or get help from your problem.


if your config files have errors, your server will refuse to start. You can read in the logfile what is happening and report it to us in case should you need help.

The fact that when you start postgresql it does not return errors, is suspicious to me, therefore it might be that everything is ok, but you cannot connect to your instance.

Maybe answering to the following, will give to us a better picture:

- do you see postgres running on the processes list of the system after you start 9.5 instance?

- do you have special needs to run 'createdb'? because a pg_dumpall might turn out handy, depending from your situation (instead of pg_dump)

- can you connect to your db instance running 'psql' before and after the operations? (as in: before stopping 9.1 - after starting 9.1 - after starting 9.5 )

- I think your previous point '3. Adjust (9.1) postgresql.conf port entry from 5432 to 5431' is not needed in your case, since after the dump you do not need 9.1 any longer. Or there is anything I am missing?


hope it helps,

fabio pardi




On 20/08/18 15:43, Mike Dewhirst wrote:
Fabio

Yes. I should have said I have been testing on a duplicate VM copy of the system. As soon as I can do it successfully I'll schedule the upgrade and announce downtime for the process.

My problem is that I cannot switch the 9.1 server off and the 9.5 server on!

I'm doing something wrong!

M

Connected by Motorola


Fabio Pardi <f.pardi@portavita.eu> wrote:

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: Fabio Pardi
Date:
Subject: Re: Switching from 9.1 to 9.5 on Ubuntu 16.04
Next
From: Mike Dewhirst
Date:
Subject: Re: Switching from 9.1 to 9.5 on Ubuntu 16.04