Introduction
This Tcl script connects, exports, downloads and imports from remote to local PostgreSQL server.
Steps
- Connect to a remote server
- Connect to a PostgreSQL Server & export the preferred schema
- Download the exported [schema].[DATE].sql to your computer
- Delete the [schema] from your local PostgreSQL Server
- Import the freshly downloaded [schema].[DATE].sql file to that schema
How to use
Use config.example.tcl
as sample configuration file.
Copy config.example.tcl
to config.tcl
:
cp config.example.tcl config.tcl
Edit config.tcl
to match your environment settings.
The script should have execute permissions in order to be executable:
chmod u+x script.sh
Then simply run it by calling:
./script.sh