ssh_db_import
Import a database dump file into a target database on a remote server, replacing existing objects. Supports MySQL, PostgreSQL, MongoDB, and automatic decompression of .gz files.
Instructions
Imports a dump file into a target database on the remote server and is destructive to existing data. PostgreSQL uses pg_restore --clean --if-exists which DROPs existing objects before loading; MongoDB uses mongorestore with --drop controlled by the drop flag (default true); MySQL pipes the file into the live database, replacing objects defined in it. Supports mysql, postgresql, mongodb. Compressed .gz inputs are decompressed automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Server name | |
| type | Yes | Database type | |
| database | Yes | Target database name | |
| inputFile | Yes | Input file path (on remote server) | |
| dbUser | No | Database user | |
| dbPassword | No | Database password | |
| dbHost | No | Database host (default: localhost) | |
| dbPort | No | Database port | |
| drop | No | Drop existing collections/tables before import (MongoDB only, default: true) |