Обсуждение: User profile location redirect

Поиск
Список
Период
Сортировка

User profile location redirect

От
Andrew Sanderson
Дата:
All,
     I am curious if there is a way to redirect user data from being stored in 'AppData' to being stored in a different file share (i.e D:\Home\"username"\pgAdmin\

I'm using Windows Server 2019 for pgAdmin 4.

I'm looking to do this to resolve users losing data when servers are rebuilt during AWS AMI's updates.

Thanks in advance,

Andrew Sanderson

Owner, Sanderson Consulting, LLC (336)602-7506


Re: User profile location redirect

От
Aditya Toshniwal
Дата:
Hi Andrew,

Yes you can. Please refer - https://www.pgadmin.org/docs/pgadmin4/4.24/server_deployment.html#configuration. Make sure you escape the backslashes when setting the paths (eg - D:\\Home)

On Fri, Aug 14, 2020 at 12:14 AM Andrew Sanderson <andrew@sandersonconsultingllc.com> wrote:
All,
     I am curious if there is a way to redirect user data from being stored in 'AppData' to being stored in a different file share (i.e D:\Home\"username"\pgAdmin\

I'm using Windows Server 2019 for pgAdmin 4.

I'm looking to do this to resolve users losing data when servers are rebuilt during AWS AMI's updates.

Thanks in advance,

Andrew Sanderson

Owner, Sanderson Consulting, LLC (336)602-7506




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"

Re: User profile location redirect

От
Andrew Sanderson
Дата:
Where is this section does it need to be placed?  We have tried several different iterations.

# Data directory for storage of config settings etc. This shouldn't normally
# need to be changed - it's here as various other settings depend on it.
# On Windows, we always store data in %APPDATA%\pgAdmin. On other platforms,
# if we're in server mode we use /var/lib/pgadmin, otherwise ~/.pgadmin
if IS_WIN:
    # Use the short path on windows
    DATA_DIR = os.path.realpath(
        os.path.join(fs_short_path(env('APPDATA')), u"pgAdmin")
    )
else:
    if SERVER_MODE:
        DATA_DIR = '/var/lib/pgadmin'
    else:
        DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))




Andrew Sanderson

Owner, Sanderson Consulting, LLC (336)602-7506



From: Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>
Sent: Monday, August 17, 2020 12:25 AM
To: Andrew Sanderson <andrew@sandersonconsultingllc.com>
Cc: pgadmin-support@lists.postgresql.org <pgadmin-support@lists.postgresql.org>
Subject: Re: User profile location redirect
 
Hi Andrew,

Yes you can. Please refer - https://www.pgadmin.org/docs/pgadmin4/4.24/server_deployment.html#configuration. Make sure you escape the backslashes when setting the paths (eg - D:\\Home)

On Fri, Aug 14, 2020 at 12:14 AM Andrew Sanderson <andrew@sandersonconsultingllc.com> wrote:
All,
     I am curious if there is a way to redirect user data from being stored in 'AppData' to being stored in a different file share (i.e D:\Home\"username"\pgAdmin\

I'm using Windows Server 2019 for pgAdmin 4.

I'm looking to do this to resolve users losing data when servers are rebuilt during AWS AMI's updates.

Thanks in advance,

Andrew Sanderson

Owner, Sanderson Consulting, LLC (336)602-7506




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"

Re: User profile location redirect

От
Aditya Toshniwal
Дата:
Hi Andrew,

No, don't change the config.py directly. Create a new file naming config_local.py in the same directory and paste the following in it:
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'

Change the values above to the desired location. Restart the pgadmin server to reflect the change.

On Tue, Aug 18, 2020 at 3:05 AM Andrew Sanderson <andrew@sandersonconsultingllc.com> wrote:
Where is this section does it need to be placed?  We have tried several different iterations.

# Data directory for storage of config settings etc. This shouldn't normally
# need to be changed - it's here as various other settings depend on it.
# On Windows, we always store data in %APPDATA%\pgAdmin. On other platforms,
# if we're in server mode we use /var/lib/pgadmin, otherwise ~/.pgadmin
if IS_WIN:
    # Use the short path on windows
    DATA_DIR = os.path.realpath(
        os.path.join(fs_short_path(env('APPDATA')), u"pgAdmin")
    )
else:
    if SERVER_MODE:
        DATA_DIR = '/var/lib/pgadmin'
    else:
        DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))




Andrew Sanderson

Owner, Sanderson Consulting, LLC (336)602-7506



From: Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>
Sent: Monday, August 17, 2020 12:25 AM
To: Andrew Sanderson <andrew@sandersonconsultingllc.com>
Cc: pgadmin-support@lists.postgresql.org <pgadmin-support@lists.postgresql.org>
Subject: Re: User profile location redirect
 
Hi Andrew,

Yes you can. Please refer - https://www.pgadmin.org/docs/pgadmin4/4.24/server_deployment.html#configuration. Make sure you escape the backslashes when setting the paths (eg - D:\\Home)

On Fri, Aug 14, 2020 at 12:14 AM Andrew Sanderson <andrew@sandersonconsultingllc.com> wrote:
All,
     I am curious if there is a way to redirect user data from being stored in 'AppData' to being stored in a different file share (i.e D:\Home\"username"\pgAdmin\

I'm using Windows Server 2019 for pgAdmin 4.

I'm looking to do this to resolve users losing data when servers are rebuilt during AWS AMI's updates.

Thanks in advance,

Andrew Sanderson

Owner, Sanderson Consulting, LLC (336)602-7506




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"


--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"