GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.pgadmin.org — Import/Export Servers — pgAdmin 4 9.19 documentation
This page in other versions:
Latest
(9.19) | 9.18 | 9.17 | Development
Warning: this documentation is for a pre-release version of pgAdmin 4. Contents
Import/Export Servers¶Server definitions (and their groups) can be exported to a JSON file and re-imported to the same or a different system to enable easy pre-configuration of pgAdmin. Using pgAdmin 4 GUI¶To launch the Import/Export Servers… tool, navigate through Tools on the menu bar to click on the Import/Export Servers option.
Click the Next button to continue, or the X button to close the wizard.
Click the Next button to continue, or the X button to close the wizard.
Check the summary of the servers that are going to be imported/exported on the Summary page. Click the Finish button to close the wizard. Using ‘setup.py’ command line script¶Note To export or import servers using Exporting Servers¶To export the servers defined in an installation, simply invoke /path/to/python /path/to/setup.py dump-servers output_file.json # or, to specify a non-default user name and auth source (the default is Internal): /path/to/python /path/to/setup.py dump-servers output_file.json --user [email protected] --auth_source ldap # to specify a pgAdmin config DB file: /path/to/python /path/to/setup.py dump-servers output_file.json --sqlite-path /path/to/pgadmin4.db To export only certain servers, use the /path/to/python /path/to/setup.py dump-servers output_file.json --server 1 --server 2 --server 5 Importing Servers¶To import the servers defined in a JSON file, simply invoke /path/to/python /path/to/setup.py load-servers input_file.json # or, to replace the list of servers with the newly imported one: /path/to/python /path/to/setup.py load-servers input_file.json --replace # or, to specify a non-default user name and auth source (the default is Internal) to own the new servers: /path/to/python /path/to/setup.py load-servers input_file.json --user [email protected] # to specify a pgAdmin config DB file: /path/to/python /path/to/setup.py load-servers input_file.json --sqlite-path /path/to/pgadmin4.db If any Servers are defined with a Server Group that is not already present in the configuration database, the required Group will be created. JSON format¶The JSON file format used when importing or exporting servers is quite straightforward and simply contains a list of servers, with a number of attributes. The following attributes are required to be present in every server definition: Name, Group, Port, Username, SSLMode, MaintenanceDB and one of Host, HostAddr or Service. A shared server may supply SharedUsername in place of Username, in which case the shared username is also used as the username of the imported server. Password fields cannot be imported or exported. In desktop mode, The following example shows both a minimally defined and a fully defined server: { "Servers": { "1": { "Name": "Minimally Defined Server", "Group": "Server Group 1", "Port": 5432, "Username": "postgres", "Host": "localhost", "MaintenanceDB": "postgres", "ConnectionParameters": { "sslmode": "prefer", "connect_timeout": 10 } }, "2": { "Name": "Fully Defined Server", "Group": "Server Group 2", "Host": "host.domain.com", "Port": 5432, "MaintenanceDB": "postgres", "Username": "postgres", "Role": "my_role_name", "Comment": "This server has every option configured in the JSON", "DBRestriction": "live_db test_db", "Shared": false, "SharedUsername": "postgres", "BGColor": "#ff9900", "FGColor": "#000000", "Service": "postgresql-10", "UseSSHTunnel": 1, "TunnelHost": "192.168.1.253", "TunnelPort": 22, "TunnelUsername": "username", "TunnelAuthentication": 1, "TunnelIdentityFile": "/Users/<user>/.ssh/id_rsa.pub", "TunnelKeepAlive": 30, "PasswordExecCommand": "echo 'test'", "PasswordExecExpiration": 100, "KerberosAuthentication": true, "ConnectionParameters": { "sslmode": "prefer", "connect_timeout": 10, "passfile": "/Users/<user>/.pgpass", "sslcert": "/Users/<user>/.ssh/cert" }, "Tags": [ { "color": "#EC0BB4", "text": "Development" } ], "PostConnectionSQL": "set timezone='America/New_York'" } } } Note If you’re running pgAdmin in Server Mode, the values for parameters that require file paths should be specified relative to the user’s home directory which is /<DATA_DIR>/storage/<user_id>/. If DATA_DIR is not specified, then it will be /var/lib/pgadmin/storage/<user_id>/ |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |