SchemaForge 2.0.2

dotnet add package SchemaForge --version 2.0.2
                    
NuGet\Install-Package SchemaForge -Version 2.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SchemaForge" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SchemaForge" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SchemaForge" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SchemaForge --version 2.0.2
                    
#r "nuget: SchemaForge, 2.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SchemaForge@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SchemaForge&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SchemaForge&version=2.0.2
                    
Install as a Cake Tool

Build NuGet NuGet Downloads License

SchemaForge

A high-performance Cross-Database Migration Engine for .NET that ports schemas and data between different database vendors. Designed for enterprise-scale modernizations, SchemaForge handles complex views, cross-schema foreign keys, and massive datasets with ease.


💡 Engine vs. Tool: When to use SchemaForge?

It is important to distinguish SchemaForge from "Schema Evolution" tools like Liquibase or Flyway:

  • Liquibase / Flyway are for Version Control. Use them to manage incremental changes (v1 → v2) within the same database vendor over time.
  • SchemaForge is a Porting Engine. Use it to move an entire system from one vendor to another (e.g., SQL Server → PostgreSQL). It automates the complex translation of data types, SQL dialects for views, and handling of legacy data orphans.

Supported Databases

  • SQL Server (source and target)
  • PostgreSQL (source and target)
  • MySQL (source and target)
  • Oracle (source and target)

Features

  • Robust Schema Migration - Automatic creation of tables, primary keys, and complex foreign key relationships across all 4 platforms.
  • Enterprise-Grade Constraints - Implements "Future Enforcement, Past Forgiveness" model using ENABLE NOVALIDATE (Oracle), NOT VALID (Postgres), and WITH NOCHECK (SQL Server) to ensure migrations complete even with legacy data orphans.
  • Automated Infrastructure - Automatically creates target databases, schemas, and Oracle users/permissions on-the-fly.
  • High-Performance Data Transfer - Parallel table migration with batched bulk writes, read-ahead pipelines, and sql_log_bin=0 (MySQL) for maximum speed and disk efficiency.
  • Intelligent View Migration - Sophisticated SQL dialect conversion for view definitions, handling complex functions like DECODE, BITAND, SYSDATETIME, and varied quoting styles.
  • Verified with WideWorldImporters - Stress-tested and verified using the full, multi-schema production dataset from Microsoft.
  • Plugin-Based Architecture - Fully extensible provider model built on .NET 9 and standard interfaces.
  • Dry Run Mode - Generate and preview complete migration SQL scripts without executing against the target.

Quick Start

Install as a .NET global tool

# Install from NuGet
dotnet tool install --global SchemaForge.Cli

# Run a migration
schemaforge --from postgres --to oracle \
  --source-conn "Host=127.0.0.1;Database=prod;Username=pg;Password=..." \
  --target-conn "User Id=system;Password=...;Data Source=127.0.0.1:1521/FREEPDB1" \
  --schema SALES --verbose

Use as a library in your .NET app

dotnet add package SchemaForge
dotnet add package SchemaForge.Providers.SqlServer
dotnet add package SchemaForge.Providers.Postgres
using SchemaForge.Builder;

await DbMigrate
    .FromSqlServer(srcConn)
    .ToPostgres(targetConn, "public")
    .MigrateAll()
    .WithMaxParallelTables(4)
    .ExecuteAsync();

CLI Usage

Option Type Default Description
--from string - Source DB type: sqlserver, postgres, mysql, oracle
--to string - Target DB type: sqlserver, postgres, mysql, oracle
--schema string public Target schema name
--parallel int 4 Max parallel table migrations
--batch-size int 10000 Rows per batch
--drop-target flag false Wipe target schemas before starting

Data Type Mapping

SQL Server PostgreSQL MySQL Oracle
tinyint boolean TINYINT(1) NUMBER(3)
bit boolean TINYINT(1) NUMBER(1)
varchar(n) character varying(n) VARCHAR(n) VARCHAR2(n)
datetime2 timestamp DATETIME TIMESTAMP

Changelog

v2.0.2 — Enterprise Resilience Update

  • Major Release — Full 12-path verification matrix complete with WWI dataset.
  • Robust FKs — Implemented ENABLE NOVALIDATE (Oracle), NOT VALID (Postgres), and WITH NOCHECK (SQL Server).
  • MySQL Driver Upgrade — Switched to MySqlConnector for superior Docker/SSL stability.
  • Infrastructure Automation — Added EnsureDatabaseExistsAsync for SQL Server and MySQL.
  • Dialect Expansion — Added support for BITAND, DECODE, and FROM_TZ translations.
  • API Enhancement — New WithMaxParallelTables(n) and WithSourceSchemaFilter fluent methods.
  • Performance — Implemented sql_log_bin=0 for MySQL to prevent "Disk Full" errors during large moves.
  • Bug Fixes — Fixed 15+ critical bugs in view routing, regex backreferences, and identifier quoting.

v1.0.51

  • Fixed SQL Server to SQL Server migration issues and cross-schema FK references.

License: MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 27 3/9/2026
2.0.1 34 3/7/2026