Database copy tool

Figure 986. Source and target database Slide presentation

Consider two potentially differing database systems e.g. Postgresql and Mysql.

Source database:

Hosting an active instance i.e. a set of tables containing data records and optionally views.

Destination database

Yet empty or containing non-conflicting table and view names.

We assume full JDBC read access to our source database and full read/write access to the destination database.


Figure 987. Copy process Slide presentation
  1. Source to destination copy addressing vendor specific SQL syntax rules.

  2. Transfer as many integrity constraints as possible:

    • Differing data types.

    • null / not null constraints.

    • Column default values.

    • Primary / candidate key constraints.

    • Foreign key constraints.

    • Check constraints.


Figure 988. Considerations Slide presentation
  • null / not null defaults may differ on both database systems.

  • The destination database may be a non-SQL database like Mongodb supporting a limited subset of schema constraints. A copy tool thereby supports database migration.

Tip

Useful technologies: