Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recovering from depclean wiping active postgres
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 810
Location: Cape Town, South Africa

PostPosted: Thu Oct 08, 2015 6:38 pm    Post subject: Recovering from depclean wiping active postgres Reply with quote

hi

emerge --depclean wiped my active postgres.

I'm trying to follow the wiki on migrating from 9.3 to 9.4, but this command

Code:

pg_upgrade -U postgres -d /var/lib/postgresql/9.3/data -D /var/lib/postgresql/9.4/data -b /usr/lib/postgresql-9.3/bin -B /usr/lib/postgresql-9.4/bin


fails because depclean has wiped the 9.3/bin folder.

I'm left with
Code:

$ locate postgresql-9.3
/etc/postgresql-9.3
/etc/postgresql-9.3/pg_hba.conf
/etc/postgresql-9.3/pg_ident.conf
/etc/postgresql-9.3/postgresql.conf
/etc/runlevels/default/postgresql-9.3
(and stuff in portage)


Is is safe to just rename 9.3/data to 9.4/data?

I've never had to update postgres before, and the mysql methodology is far more simpler and automated.

Suggestions as to how to proceed gratefully received ;-)

thanks, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8931

PostPosted: Thu Oct 08, 2015 6:51 pm    Post subject: Reply with quote

If you need postgresql-9.3 to migrate old DBs, then emerge it. The upgrade assumes that 9.3 is still there after you installed 9.4.
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 810
Location: Cape Town, South Africa

PostPosted: Thu Oct 08, 2015 7:11 pm    Post subject: Reply with quote

genstorm wrote:
If you need postgresql-9.3 to migrate old DBs, then emerge it. The upgrade assumes that 9.3 is still there after you installed 9.4.


Thanks, I figured I would need to do that. Will give it a shot later (busy working atm)

cheers, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 810
Location: Cape Town, South Africa

PostPosted: Fri Oct 09, 2015 1:50 am    Post subject: Reply with quote

genstorm wrote:
If you need postgresql-9.3 to migrate old DBs, then emerge it. The upgrade assumes that 9.3 is still there after you installed 9.4.


pg_upgrade was going well until

Code:

lc_collate cluster values do not match:  old "en_ZA.UTF-8", new "C"
Failure, exiting


Can't find where to set lc_collate, it seems to be passed as command line parameter when creating database, (as example in arch linux wiki), but Gentoo does
Code:

Then, execute the following command to setup the initial database
 * environment:
 *     emerge --config =dev-db/postgresql-9.4.4


and I can't find where else to set lc_collate....

I have
Code:

# cat /etc/env.d/02locale
LANG="en_ZA.UTF-8"
LC_COLLATE="C"


but can't remember when last I edited that file... and howcome 9.3 has en_ZA.UTF-8.

Should I just edit 02locale and rerun emerge --config =dev-db/postgresql-9.4.4 ?

thanks, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 810
Location: Cape Town, South Africa

PostPosted: Sat Oct 10, 2015 9:13 pm    Post subject: Reply with quote

iandoug wrote:

Should I just edit 02locale and rerun emerge --config =dev-db/postgresql-9.4.4 ?


Yes.
1. edit 02locale
2. re-emerge 9.4.4
3. emerge --config as above
4. su - postgres
5. pg_upgrade -U postgres -d /var/lib/postgresql/9.3/data -D /var/lib/postgresql/9.4/data -b /usr/lib/postgresql-9.3/bin -B /usr/lib/postgresql-9.4/bin
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum