Added support to import/export server groups and servers from GUI. Fixes #4803

This commit is contained in:
Akshay Joshi
2022-01-04 12:27:17 +05:30
parent c1ad7d81f4
commit 9dd957a2aa
22 changed files with 1297 additions and 329 deletions

View File

@@ -1,4 +1,4 @@
.. _export_import_servers:
.. _import_export_servers:
******************************
`Import/Export Servers`:index:
@@ -6,14 +6,62 @@
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. The ``setup.py`` script is used for this purpose.
of pgAdmin.
.. note:: To export or import servers, you must use the Python interpreter that
is normally used to run pgAdmin to ensure that the required Python
packages are available. In most packages, this can be found in the
Python Virtual Environment that can be found in the installation
directory. When using platform-native packages, the system installation
of Python may be the one used by 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.
.. image:: images/import_export_servers_step1.png
:alt: Import/Export Servers step one page
:align: center
* Use the *Import/Export* field to select the Server Groups/Servers
to be imported or exported.
* Use the *Filename* field to select the JSON file to import servers or create the
new file in case of Export where the servers to be exported in the JSON format.
* Use the *Replace existing servers?* field to specify whether to replace the
existing servers or not. This field is applicable only in case of Import Servers.
Click the *Next* button to continue, or the *X* button to close the wizard.
.. image:: images/import_export_servers_step2.png
:alt: Import/Export Servers step two page
:align: center
* Select the Server Groups/ Servers to be imported/exported.
Click the *Next* button to continue, or the *X* button to close the wizard.
.. image:: images/import_export_servers_step3.png
:alt: Import/Export Servers step three page
:align: center
Check the summary of the imported/exported servers on the Summary page.
Click the *Finish* button to close the wizard.
.. image:: images/import_export_servers_refresh_tree.png
:alt: Import/Export Servers Tree Refresh
:align: center
In case of importing the server above confirmation box will be popped up to
confirm whether to refresh the browser tree or later.
Using 'setup.py' command line script
####################################
.. note:: To export or import servers using ``setup.py`` script, you must use
the Python interpreter that is normally used to run pgAdmin to ensure
that the required Python packages are available. In most packages, this
can be found in the Python Virtual Environment that can be found in the
installation directory. When using platform-native packages, the system
installation of Python may be the one used by pgAdmin.
Exporting Servers
*****************