Migration
Overview
The Migration feature allows administrators to migrate database tables between supported database platforms while optionally applying existing OneDB data protection policies during the migration process.
Migration can be used for database consolidation, environment refreshes, cloud migration projects, test data preparation, or moving data between different database vendors. During migration, OneDB can automatically apply tokenization policies based on existing Field Settings configurations, helping organizations protect sensitive data before it reaches the target database.
Currently, OneDB supports migration between supported database platforms, including:
- PostgreSQL
- Oracle
- Microsoft SQL Server
- MySQL
Key Features
- Cross-database migration between supported database platforms
- Table structure (DDL) generation
- Data migration with configurable batch processing
- Automatic target table creation
- Optional target table truncation
- Tokenization of protected fields using existing Field Settings policies
- Migration preview before execution
- Migration job tracking and execution history
- Real-time execution monitoring and progress reporting
Migration Workflow
The migration process consists of four steps:
- Source and Target Selection
- Table and Migration Options
- DDL and Transformation Preview
- Migration Execution
Step 1 – Select Source and Target
In the first step, select the source database connection and target database connection.
Source Connection
Choose:
- Source database connection
- Source schema or database
Target Connection
Choose:
- Target database connection
- Target schema or database
After both sides are selected, click Next to continue.
Example
Source:
- MySQL
- Database:
dummy
Target:
- Oracle
- Schema:
DUMMY
Step 2 – Select Tables and Configure Migration Options
Select one or more source tables to migrate.
Source Tables
The table list displays:
- Table name
- Validation status
Only tables marked as READY can be migrated.
Migration Options
Create Table If Not Exists
Automatically creates the target table if it does not already exist.
Recommended for most migrations.
Truncate Before Insert
Removes all existing rows from the target table before inserting migrated data.
Useful when refreshing existing environments.
Drop And Recreate
Drops the target table and recreates it using the generated DDL.
Use carefully, as existing data will be removed.
Append Data
Inserts migrated data into the existing target table without removing existing rows.
Target Table Name
Optional.
When left empty, OneDB automatically generates a target table name using the following format:
source_table_onedb_migrated
Example:
transactions_onedb_migrated
Data Transformation
Tokenize Protected Fields
Applies existing Field Settings protection policies during migration.
If a source column is configured for tokenization in OneDB, the migrated data will be tokenized automatically before insertion into the target database.
This allows organizations to migrate production data into development, testing, analytics, or external environments without exposing sensitive information.
Example
Original value:
4111111111111111
Migrated value:
2678494151932013
The transformation behavior follows the configured template assigned in Field Settings.
Error Handling
Stop On Error
Migration stops immediately when an error occurs.
Recommended when data consistency is critical.
Skip Failed Row
Rows that fail migration are skipped and processing continues.
Useful when migrating large datasets where isolated data issues should not interrupt the entire migration.
Row Limit
Limits the number of rows migrated from the source table.
Useful for:
- Testing
- Validation
- Proof-of-concept migrations
Example:
1000
Only the first 1,000 rows will be migrated.
Batch Size
Controls how many rows are processed in a single migration batch.
Example values:
100
500
1000
5000
Larger batch sizes may improve performance but require more memory.
Step 3 – Review Columns and DDL Preview
Before execution, OneDB generates a preview of:
- Source columns
- Target column types
- Nullable settings
- Transformation policies
- Generated target DDL
Transformation Policy Preview
Displays all protected fields that will be transformed during migration.
Example:
| Source Column | Mode | Template |
|---|---|---|
| credit_card | TOKENIZE | App_With_Masking |
| transaction_code | TOKENIZE | App_Without_Masking |
This preview helps verify that protection policies are correctly applied before migration begins.
DDL Preview
OneDB generates the target table definition based on the selected source table and target database platform.
Example:
CREATE TABLE DUMMY.TRANSACTIONS_ONEDB_MIGRATED (
ID NUMBER(19) NOT NULL,
USER_ID NUMBER(19) NOT NULL,
TRANSACTION_CODE VARCHAR2(100) NOT NULL,
AMOUNT NUMBER(18,2) NOT NULL
);
Review the generated DDL carefully before continuing.
Step 4 – Migration Summary and Execution
The final step displays a complete migration summary.
Information includes:
- Source connection
- Target connection
- Selected tables
- Target table names
- Data transformation mode
- Error handling mode
- Batch size
- Row limit
- Table creation options
After verification, click Start Migration.
Confirmation
Before execution begins, OneDB displays a confirmation dialog.
This provides a final opportunity to review the selected options before any changes are made to the target database.
Migration Monitoring
Once started, the migration job enters the execution queue.
The Execution Summary displays:
- Current status
- Tables completed
- Rows read
- Rows inserted
- Failed rows
- Duration
- Job identifier
Migration Status
Possible statuses include:
| Status | Description |
|---|---|
| Queued | Waiting for execution |
| Running | Migration is in progress |
| Completed | Migration finished successfully |
| Failed | Migration encountered an error |
| Cancelled | Migration was stopped by the user |
Execution Result
For each table, OneDB displays:
- Source table
- Target table
- Migration status
- Rows read
- Rows inserted
- Failed rows
- Result message
This allows administrators to review migration outcomes and identify any issues.
Migration Jobs
All migration executions are stored in the Migration Jobs page.
The job list includes:
- Job name
- Action type
- Status
- Scheduled execution time
- Creation date
Administrators can review previous migrations and inspect execution details at any time.
Best Practices
- Test migrations using a small Row Limit before migrating full datasets.
- Review DDL previews carefully before execution.
- Use Tokenize Protected Fields when migrating production data to non-production environments.
- Use Stop On Error for critical production migrations.
- Validate target database storage capacity before large migrations.
- Choose appropriate batch sizes based on available system resources.
- Review Field Settings policies before running migrations involving sensitive data.
Notes
- Migration uses existing OneDB Field Settings configurations when tokenization is enabled.
- Source data is never modified during migration.
- Tokenization is applied only to fields configured with active protection policies.
- Generated target table names can be customized before execution.
- Large migrations may take longer depending on network speed, database performance, and batch size configuration.