Re: Moving pgadmin4.db to a new server

From: Jan Birk <jan(dot)g(dot)birk(at)gmail(dot)com>
To: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
Cc: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>, pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Moving pgadmin4.db to a new server
Date: 2019-10-22 06:41:23
Message-ID: 5c26f0ff514a6f52b2c9919070c0609d94a4e4fc.camel@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi Aditya
Maybe I am not clear on the objective:
We have to migrate the PGadmin away from server1 running OEL 7 to a new server2 running Ubuntu 18.04
In that process we must keep the users (+100) settings and password. We are - however - able to keep the settings by just moving the db file from server1 to
server2.
But the passwords are salted different on the new server2 and therefor all the users will have to re-enter ther passwords. Most of them has proberly forgot the
passwords.
So how do I migrate from one server to another keeping settings (that part works) and passwords (this is not working).
I think that more and more will need that functionality (changing the host running pgadmin) as times goes by.
Sadly I do not know python but it seems that pgadmin maybe could be re-initialized using the old SALT by setting SECURITY_PASSWORD_SALT or something .. ? :-)

Best and thanks again for a very good product.
/Jan

tir, 22 10 2019 kl. 10:59 +0530, skrev Aditya Toshniwal:
> Hi Jan,
>
> Try this,
> 1) Remove all the existing session data. For that, shut down the server, go to sessions directory just beside the db file and remove all the files in it.
> 2) Go to browser and clean all the cache.
> 3) Start pgAdmin4 and open a new window.
> Let us know if this works.
>
> On Sun, Oct 20, 2019 at 12:51 PM Jan Birk <jan(dot)g(dot)birk(at)gmail(dot)com> wrote:
> > Hi and thanks for your efforts and time
> >
> >
> >
> > søn, 20 10 2019 kl. 11:45 +0530, skrev Aditya Toshniwal:
> >
> > > How did you copy the .db file ?
> >
> > > Did you copy first and then started pgAdmin or started first and then copied.
> >
> > > When pgAdmin4 starts, it checks the schema version of .db file and applies the
> >
> > > migrations till the current version.
> >
> >
> >
> >
> >
> > We did copy and then started. That's explain why the schema *seems* to be ok :-)
> >
> >
> >
> > We haven't moved the production site yet. But every thing in out test looks ok
> >
> > expect the passwords.
> >
> >
> >
> > Not knowing python (just grep) it seems that the SALT is auto generated in
> >
> > config-database??
> >
> >
> >
> > ../migrations/versions/xxxxxx_.py
> >
> > ..
> >
> >
> >
> > 114 current_salt = getattr(
> >
> > 115 config, 'SECURITY_PASSWORD_SALT',
> >
> > base64.urlsafe_b64encode(
> >
> > 116 os.urandom(32)
> >
> > 117 ).decode()
> >
> > 118
> >
> > )
> >
> > ..
> >
> >
> >
> > Could it be a workaround to re-initialize (re-install) pgadmin having
> >
> > current_salt equals the old one ???
> >
> >
> >
> > Best
> >
> >
> >
> > Jan
> >
> >
> >
>
>

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Michael Shapiro 2019-10-22 17:46:12 encrypted passwords?
Previous Message Aditya Toshniwal 2019-10-22 05:29:49 Re: Moving pgadmin4.db to a new server