OSX: migrating Postgres db from one Mac to another

Started by Carlo Posoalmost 5 years ago4 messagesgeneral
Jump to latest
#1Carlo Poso
carloposo@gmail.com

Hello,
my Mac unfortunately crashed. I have a Time Machine backup.
Using the Migration Assistant on a new Mac allowed me to get all my
documents back, but unfortunately Postgres is not able to start.

So I was trying to manually set-up my Postgres db.

Here are the steps:

- install a fresh copy of Postgres (v11)
- replace the /Library/PostgreSQL/11/data folder with the one I dig out
from my dead Mac, where I assume my data is stored
- check/fix owner of folders (must be 'postgres', I assume)
- start pgAdmin
- enter the PW for postgres user
- click on "PostgreSQL 11" server to show databases

This is where I have problems. I am prompted with the same pop-up asking me
to enter the password for the user 'postgres'. I type it and I get the
following:
[image: Screen Shot 2021-06-24 at 15.25.03.png]

*Carlo*

Attachments:

Screen Shot 2021-06-24 at 15.25.03.pngimage/png; name="Screen Shot 2021-06-24 at 15.25.03.png"Download+2-1
#2Дмитрий Иванов
firstdismay@gmail.com
In reply to: Carlo Poso (#1)
Re: OSX: migrating Postgres db from one Mac to another

# -*- coding: utf-8 -*-

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2021, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
# config.py - Core application configuration settings
#
##########################################################################
.........
##########################################################################
# Master password is used to encrypt/decrypt saved server passwords
# Applicable for desktop mode only
##########################################################################
MASTER_PASSWORD_REQUIRED = True -> False

чт, 24 июн. 2021 г. в 18:44, Carlo Poso <carloposo@gmail.com>:

Show quoted text

Hello,
my Mac unfortunately crashed. I have a Time Machine backup.
Using the Migration Assistant on a new Mac allowed me to get all my
documents back, but unfortunately Postgres is not able to start.

So I was trying to manually set-up my Postgres db.

Here are the steps:

- install a fresh copy of Postgres (v11)
- replace the /Library/PostgreSQL/11/data folder with the one I dig
out from my dead Mac, where I assume my data is stored
- check/fix owner of folders (must be 'postgres', I assume)
- start pgAdmin
- enter the PW for postgres user
- click on "PostgreSQL 11" server to show databases

This is where I have problems. I am prompted with the same pop-up asking
me to enter the password for the user 'postgres'. I type it and I get the
following:
[image: Screen Shot 2021-06-24 at 15.25.03.png]

*Carlo*

Attachments:

Screen Shot 2021-06-24 at 15.25.03.pngimage/png; name="Screen Shot 2021-06-24 at 15.25.03.png"Download+2-1
#3Carlo Poso
carloposo@gmail.com
In reply to: Дмитрий Иванов (#2)
Re: OSX: migrating Postgres db from one Mac to another

Thanks.
The message I get after entering the PW is "could not connect to server:
Connection refused Is the server
running on host "localhost" (::1) and accepting TCP/IP connections on port
5432? could not connect to server: Connection refused Is the server running
on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port
5432?"

*Carlo*

Il giorno gio 24 giu 2021 alle ore 15:55 Дмитрий Иванов <
firstdismay@gmail.com> ha scritto:

Show quoted text

# -*- coding: utf-8 -*-

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2021, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
# config.py - Core application configuration settings
#
##########################################################################
.........
##########################################################################
# Master password is used to encrypt/decrypt saved server passwords
# Applicable for desktop mode only
##########################################################################
MASTER_PASSWORD_REQUIRED = True -> False

чт, 24 июн. 2021 г. в 18:44, Carlo Poso <carloposo@gmail.com>:

Hello,
my Mac unfortunately crashed. I have a Time Machine backup.
Using the Migration Assistant on a new Mac allowed me to get all my
documents back, but unfortunately Postgres is not able to start.

So I was trying to manually set-up my Postgres db.

Here are the steps:

- install a fresh copy of Postgres (v11)
- replace the /Library/PostgreSQL/11/data folder with the one I dig
out from my dead Mac, where I assume my data is stored
- check/fix owner of folders (must be 'postgres', I assume)
- start pgAdmin
- enter the PW for postgres user
- click on "PostgreSQL 11" server to show databases

This is where I have problems. I am prompted with the same pop-up asking
me to enter the password for the user 'postgres'. I type it and I get the
following:
[image: Screen Shot 2021-06-24 at 15.25.03.png]

*Carlo*

Attachments:

Screen Shot 2021-06-24 at 15.25.03.pngimage/png; name="Screen Shot 2021-06-24 at 15.25.03.png"Download+2-1
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Carlo Poso (#3)
Re: OSX: migrating Postgres db from one Mac to another

Carlo Poso <carloposo@gmail.com> writes:

The message I get after entering the PW is "could not connect to server:
Connection refused Is the server
running on host "localhost" (::1) and accepting TCP/IP connections on port
5432? could not connect to server: Connection refused Is the server running
on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port
5432?"

So the step you missed is "start the Postgres server". On OSX
that's usually done by setting up a LaunchDaemon script, IIRC
(it's been awhile since I messed with that).

regards, tom lane