MyNixOS website logo
Description

ODBC database transfer.

Simple ODBC application that transfers data between 2 databases. It is based on sqlcli package that should be installed with the odbc flag set. To build the application, you need odbc libraries installed. On Windows, they are installed by default. On unix, you should use unixODBC package.

transfer-db

Simple ODBC application that transfers data between 2 databases.

The application uses the SQL/CLI API and only few ODBC extensions that are absolutely needed to make ODBC work. This means that the application is easily portable to other SQL/CLI implementations.

It includes a database agnostic dump file format library.

Current release is 0.3.1.1.

Release Notes

The dump and restore are not finalized yet, so they don't work with the current version.

SYNOPSYS

To use transfer-db you either right your own transfer plan by hand or use transfer-db to generate a transfer plan for you. You can edit the generated tranfer plan.

A transfer plan is an yaml file specifying the database connection parameters and what tables and data should be transferred.

Gnereating a plan:

transfer-db makePlan splitByRows <n> -d<SOURCEDB_ODBC_DATASOURCE> -u<SOURCEDB_USER_NAME> -p<SOURCEDB_PASSWORD> -s<SOURCEDB_SCHEMA> -D<DESTDB_ODBC_DATASOURCE> -U<DESTDB_USER_NAME> -P<DESTDB_PASSWORD> -S<DESTDB_SCHEMA> > my-plan.yaml

This command will generate on the standard output a plan for transferring the database SOURCEDB DESTDB in batches of <n> rows (the splitByRows sub-command). In case of failure, you could restart the process by skipping the completed batches.

After that, simply run:

transfer-db run my-plan.yaml > therun-0001.log

This command will run the plan in the my-plan.yaml file and will capture the stdout of transfer-db command into the file therun-0001.log. This file logs the transferred tables and batches and could be used to generate a corrective plan in case something went wrong. On console (stderr) there will be printed detailed information about running the plan.

For more advanced options, on controlling the number of threads or of what batches should be run, type:

transfer-db help

To generate a corrective plan, you need the original plan and the stdout log generated by the run command:

transfer-db correctivePlan my-plan.yaml -sfix-001.sql -pnew-plan.yaml -itherun-001.log

This command will read the original plan from my-plan.yaml file, the log of the previous run from therun-001.log file and will generate 2 files:

  • fix-001.sql that you will need to run to against the destination database in order to remove partial batches.
  • new-plan.yaml that you should use with for a new transfer run, to transfer the remaining records.
Metadata

Version

0.3.1.2

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows