Case Studies

Migrating a 30-year-old Database to a Modern Application Stack

The Client

A distribution and manufacturing organization had been running its core business data on a Sybase SQL Server 4.6 database hosted inside an emulated OpenVMS environment since the mid-1990s. The system’s master record consisted of 256 records spanning several locations internationally.

While the legacy system remained technically operational, the underlying platform was entirely unsupported. Direct connectivity through modern database drivers was unavailable, and the proprietary network protocol (CT-Lib/DB-Lib) was incompatible with any current Object-Relational Mapping (ORM) or Extract, Transform, Load (ETL) tooling. Since Salem Automation had done previous work on the client’s system, they sought out Salem for a viable solution.

The Problem

The client faced a core operational risk: their business-critical data was trapped in an obsolete, unsupported database system with no viable means of access with modern tools. The Sybase 4.6 platform predated Unicode, used a proprietary network protocol, and could not be reached by any current driver, ORM, or ETL framework.

Without intervention, the organization would continue to depend on aging, emulated infrastructure with no vendor support, no upgrade path, and growing exposure to data loss or system failure. The data needed to be made accessible through a modern, maintainable application without losing data integrity.

The Challenge

Migrating from Sybase 4.x to a modern SQL Server environment was far from straightforward. Several compounding factors made this engagement technically demanding:

  • No live connectivity. Direct database access was unavailable during the discovery phase; and so, the entire migration had to be driven from exported artifacts — schema descriptor files and a flat-file data export.
  • User-defined type system. The legacy schema made extensive use of Sybase user-defined types (UDTs) — named aliases over base types. Every column was defined in terms of these UDTs, requiring a full type-resolution pass before any SQL Server DDL could be authored.
  • Fixed-width character semantics. Sybase CHAR columns pad values with trailing spaces to their declared length. Any downstream system using variable-length comparison or display semantics must account for this, or risk introducing subtle data quality defects.
  • Legacy encoding. The source database predated Unicode. Values were encoded in a narrow character set, requiring careful encoding decisions at the export, transform, and import stages.

The Action: A 5-Stage Migration

Salem Automation’s solution was structured over a five-stage migration pipeline that progressed from schema analysis to enablement of the full application.

Stage 1 — Schema Analysis & Type Resolution

Schema descriptor files exported from the Sybase system catalog — equivalent to the output of sp_help and sp_help_type — served as the authoritative schema source. The UDT registry was cross-referenced against the table column list to resolve every column to its true base type (smallint, char, etc.), nullability, and storage length. This resolution step was essential because a naïve schema translation can produce DDL that appears correct but diverges from the actual storage semantics of the source.

Stage 2 — Data Export

Data was extracted from the legacy environment using Sybase bulk-copy and query export utilities, producing a pipe-delimited flat file. The format preserved the fixed-width padding of CHAR columns; null fields appeared as empty values between delimiters; and the file was UTF-8 encoded with a byte-order mark. These characteristics informed each subsequent transformation step.

Stage 3 — DDL Translation & Schema Migration

A SQL Server DDL script was authored by mapping each resolved Sybase type to its SQL Server equivalent. CHAR(n) was used rather than VARCHAR to preserve fixed-length storage semantics. The clustered unique index from the source schema was expressed as a PRIMARY KEY CLUSTERED constraint — a functionally identical construct in SQL Server. NULL and NOT NULL constraints were applied exactly as defined in the source. The resulting script was validated against a freshly provisioned SQL Server 2022 Express instance using Windows Integrated Authentication.

Stage 4 — Data Transformation & Import

The exported flat file was processed through a scripted PowerShell transformation pipeline before being loaded into SQL Server. This stage handled the nuances of the legacy format: normalizing fixed-width padding, resolving ambiguous empty fields to their correct NULL or empty-string representation, and ensuring values were correctly typed and escaped for the target database. All 256 records were imported with zero errors and independently verified against the source record count.

Stage 5 — EF Core Scaffolding & Application Enablement

With data successfully loaded into SQL Server, the application data access layer was generated directly from the migrated schema using Entity Framework Core’s reverse-engineering tooling rather than being authored by hand. This approach ensures the application model accurately reflects the actual storage characteristics of the data. The generated code was structured using partial classes, so custom application logic is kept separate and the data layer can be regenerated as additional tables are brought across without overwriting business code.

The Results

In the end, the solution provided a fully operational modern application: a .NET 8 WPF desktop client backed by SQL Server 2022 Express, with Entity Framework Core 8 providing the data access layer. The application follows the MVVM with Controller (MVVM+C) pattern — an extension of standard Model-View-ViewModel that introduces a dedicated Controller layer for application orchestration. This decouples navigation logic and cross-ViewModel coordination from both Views and ViewModels, keeping each layer independently testable and loosely coupled.

Prism 8 provides the module system and region-based navigation infrastructure, with an IoC container handling service registration and lifetime management. The scaffolded EF Core DbContext is registered as a singleton with a self-contained configuration entry point, making it straightforward to extend as additional tables are migrated.

Salem Automation’s solution had these outcomes:

  • 100% data fidelity. All 256 customer master records migrated with zero import errors and independently verified against the source.
  • Modern, maintainable platform. Business-critical data resides in the SQL Server 2022 and accessible through a .NET 8 WPF application built on industry-standard frameworks.
  • Iterative migration readiness. The partial-class scaffolding approach allows additional tables to be brought across incrementally without disrupting existing application logic.

The Results

In the end, the solution provided a fully operational modern application: a .NET 8 WPF desktop client backed by SQL Server 2022 Express, with Entity Framework Core 8 providing the data access layer. The application follows the MVVM with Controller (MVVM+C) pattern — an extension of standard Model-View-ViewModel that introduces a dedicated Controller layer for application orchestration. This decouples navigation logic and cross-ViewModel coordination from both Views and ViewModels, keeping each layer independently testable and loosely coupled.

Prism 8 provides the module system and region-based navigation infrastructure, with an IoC container handling service registration and lifetime management. The scaffolded EF Core DbContext is registered as a singleton with a self-contained configuration entry point, making it straightforward to extend as additional tables are migrated.

Salem Automation’s solution had these outcomes:

  • 100% data fidelity. All 256 customer master records migrated with zero import errors and independently verified against the source.
  • Modern, maintainable platform. Business-critical data resides in the SQL Server 2022 and accessible through a .NET 8 WPF application built on industry-standard frameworks.
  • Iterative migration readiness. The partial-class scaffolding approach allows additional tables to be brought across incrementally without disrupting existing application logic.

Maintain Thriving Legacy Systems with Salem Automation

We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.