Analyze with AI
Get AI-powered insights from this Mad Devs article:
Your schema conversion report is ready, and the migration proposal is waiting for budget approval. Yet the engineering team still cannot confirm whether the application will calculate the same price, recognize the same customer code, and save an order correctly. Those uncertainties belong in the estimate before the project is approved.
For a SQL Server to PostgreSQL migration, start with one critical production workflow. Trace its SQL and application dependencies, identify manual changes, and define evidence that will resolve the remaining questions. This guide develops an illustrative order workflow into a scoping card you can review with the product owner, then use to decide how far a pilot should extend.
Key takeaways
- Connect each SQL dependency to an observable application operation. Give every dependency an owner and a business consequence so the inventory can support an estimate.
- Estimate schema conversion and manual behavior changes separately. Prioritize the dependencies that can alter money, identity, transaction outcomes, or the application's response contract.
- Expand the migration after a representative pilot demonstrates equivalent results. Use its findings to update assumptions, define remaining work packages, and decide which additional workflows need their own validation.
Inventory what the application depends on
Begin with operations that users and downstream systems depend on: creating an order, updating a customer, or settling an invoice. Trace both reads and writes. A useful inventory connects an entry point to its driver, ORM mappings, application queries, stored procedures, functions, triggers, and scheduled jobs. Record shared dependencies once, then associate them with every affected workflow.
Consider a hypothetical B2B portal running SQL Server 2019 with customer-code comparisons using Latin1_General_100_CI_AS. Its order procedure validates a customer code, calculates a discounted amount, and writes the order. The proposed target is PostgreSQL 17 with UTF8 encoding and deterministic C collation on a plain text customer-code column. These are illustrative settings; capture your actual versions and column overrides before estimating compatibility.
Find SQL that lives outside the database
Search repositories for connection libraries, raw SQL, procedure names, query builders, ORM provider configuration, and SQL Server-specific syntax. Include reporting services, background workers, integration scripts, and deployment migrations. Dynamic SQL needs special attention because the complete statement may only exist at runtime.
Combine code search with observed workload for the order scenario. Correlate a sanitized request with database calls and background activity using available traces or query monitoring. Exercise rejection paths and retries as well as successful orders. A schema export alone cannot reveal how a driver consumes a procedure's result or which rarely used branch emits another query.
Assign an application owner, database owner, and criticality to each finding. Mark unobserved branches explicitly. A dormant integration remains an uncertainty until its owner confirms its disposition.
Map database objects back to business behavior
Describe the order procedure through its obligations: recognize the customer, apply the agreed discount, persist the amount, and return an order identifier. Link an overnight export job to the committed orders it later consumes. This exposes work beyond the request handler.
Keep the initial assessment focused on OLTP behavior. If the project includes an analytical platform, scope that separately using a data warehouse migration strategy. Give the order pilot a clear boundary and list interfaces that require coordination beyond it.
Classify what converts and what needs redesign
Classify each dependency by its conversion path and acceptance evidence. Straightforward table definitions can enter a conversion-and-review path. Generated procedural SQL needs inspection and behavioral tests. Provider configuration, parameter binding, and response handling require application work. A dependency can involve several paths, so avoid assigning effort solely from the number of converted objects.
For the hypothetical portal, use the following matrix to separate work packages. The business invariant describes the required outcome; verification determines whether the implementation preserves it.
| Dependency | Business invariant | Conversion path | Owner and effort driver | Verification |
|---|---|---|---|---|
| Order tables and keys | Every order has valid references | Convert compatible DDL; review constraints and defaults | Database engineer; generated definitions and key mapping | Constraint failures and key relationships |
| Customer-code lookup | Accepted case variants identify the same customer | Explicit comparison strategy and supporting index | Database and application engineers; Unicode rules and uniqueness | Mixed-case matches and collision fixtures |
| Discount procedure | Saved total follows approved rounding rules | Review generated SQL; adapt expressions and numeric declarations | Database engineer; intermediate precision and branching | Boundary amounts and persisted totals |
| Procedure response | Caller receives the expected identifier and status | Adapt routine interface and application reader | Backend engineer; output parameters and result shape | API fields, types, errors, and order ID |
| Driver and transaction wrapper | One accepted request creates one complete order | Change provider, bindings, and retry handling | Backend engineer; transaction ownership and ambiguous outcomes | Duplicate submission and injected failure |
AWS's SCT action-code index, framed around SQL Server 2019 and Aurora PostgreSQL, includes code 7646 for collation conversion requiring manual attention. Such a finding identifies an object-conversion task. It does not establish application parity or predict engineering hours. Recheck findings against the selected target version and converter configuration; older playbook limitations are not universal PostgreSQL limitations.
Review types, collation, and query behavior
For the stated PostgreSQL 17 target, test the required case-insensitive customer lookup explicitly. PostgreSQL 17 collation documentation distinguishes deterministic and nondeterministic comparisons. Choose and validate a strategy for lookup, uniqueness, and indexing together. The DMS conversion settings also document comparison-related options, including citext; record the settings actually used.
Include empty strings, nulls, Unicode, case variants, and trailing spaces in fixtures. Inspect pagination ordering and implicit casts. Choose numeric precision and scale to preserve the required results, and check intermediate calculations: PostgreSQL 17 numeric documentation explains scale coercion and overflow checks. Test rounding boundaries and maximum amounts. For datetimeoffset mappings, define whether the contract preserves an instant, its original offset, or both; test date boundaries and daylight-saving transitions.
Account for drivers, transactions, and retries
Specify parameter types, null handling, returned values, and error translation. Document who begins, commits, and rolls back each transaction. Exercise timeout and retry paths against the chosen isolation settings. Verify the API response alongside database effects, especially when a connection drops after a possible commit.
Estimate manual work through one representative pilot
Select a vertical slice that crosses the dependencies creating uncertainty. The order workflow is useful because customer matching, financial calculations, routine calls, and transaction handling interact within one operation. Keep its fixtures manageable while retaining the failure paths that could change the estimate.
Choose an implementation path for each dependency. Convert and review compatible objects. Adapt application calls where the driver or routine contract changes. Consider moving procedural business logic into the application when maintainability or transaction design justifies it, and include that architectural choice in the estimate. Moving logic introduces its own implementation and validation work.
Use this illustrative assessment card as a discussion document for the pilot:
- Workflow and owners: Create an order through the portal API. The backend lead owns delivery, the database engineer owns routine adaptation, QA owns parity evidence, and the product owner confirms customer-code and rounding rules.
- Known manual work: Replace SQL Server provider configuration; bind parameters explicitly; adapt the discount routine and its response reader; implement the selected customer-code comparison; preserve the transaction and duplicate-submission contract.
- Assumptions: Existing discount rules are authoritative, one application service owns the write transaction, and an existing request key can identify duplicate submissions. These are hypotheses to confirm against code and data.
- Dependencies and unknowns: Obtain sanitized fixtures, target database configuration, extension approval if needed, and the export-job owner's input. Investigate case-colliding codes and behavior after an uncertain commit.
- Acceptance and re-estimation: Require identical accepted customers, persisted totals, response semantics, and atomic writes. Re-estimate if code collisions require cleanup, another writer appears, or retry safety requires a new persistence mechanism.
Build the range from owner estimates for these work packages. Ask each owner for a lower and upper effort bound, the assumption behind each bound, and evidence needed to narrow it. Add fixture preparation, integration, and verification explicitly. Sequence dependent tasks to derive elapsed time from staffing and availability. Keep unresolved discovery work visible; revise the range after the pilot demonstrates the chosen approach.
External projects support investigating application work. Geopits describes Techacademy's SQL Server-to-PostgreSQL move within a broader application modernization. Novum's Ispirer testimonial describes a proof of concept and customization of stored-procedure conversion. These accounts illustrate assessment and adaptation. Their scope and results provide no duration benchmark for the hypothetical portal.
Prove parity before expanding the migration
Run the same sanitized fixtures against the source and target implementations. Record SQL Server 2019 configuration, PostgreSQL 17 configuration, application revision, driver versions, and conversion settings with the results. Reset state between independent cases so earlier writes cannot conceal duplicate records or missing side effects.
Begin with the API contract: successful and rejected responses, field names, types, nullability, error categories, and identifier relationships. Generated identifiers may differ between databases; compare their referential consistency and agreed external semantics. Then inspect persisted records, including discount inputs, totals, customer references, and any audit entries that belong to the transaction.
For money, compare exact expected decimal values at the approved calculation and storage boundaries. PostgreSQL's version 17 numeric rules make declared scale relevant to stored results. A matching displayed price can conceal a different saved amount, so inspect both. Let the product owner resolve any ambiguity in rounding requirements before accepting a difference.
Resubmit the same order request and verify the agreed duplicate-handling outcome. Inject a failure between related writes and confirm that rollback leaves no partial order. Test concurrent requests and the retry after an ambiguous commit separately. Capture responses, row counts, relationships, and transaction evidence for each case. A successful routine execution alone cannot close these checks.
Once functional checks pass, compare latency under comparable concurrency, data distribution, indexes, connection-pool settings, and workload. Record throughput and error rates alongside latency to make the comparison useful. Agree on acceptable thresholds before testing. Investigate query plans and contention where thresholds fail, then include remediation in the estimate.
Wrong customer matches, different saved totals, duplicate orders, partial writes, and broken response contracts block expansion. Retain the fixture set, unresolved differences, measured capacity, and owner approvals as inputs to a separate cutover plan. The Mad Devs article on planning a database cutover covers a PostgreSQL-to-PostgreSQL context; use it for subsequent planning with that boundary in mind.
The illustrative pilot closes when the provider changes and adapted discount routine pass the agreed checks for results, resubmission, and rollback. Expand to workflows sharing those validated dependencies, and assess additional behavior separately.
Conclusion
Assign an owner to one production workflow before approving the broader migration estimate. Agree on its SQL Server dependencies, required application changes, unresolved assumptions, and acceptance evidence with engineering and the product owner. Use the pilot to replace uncertain work packages with observed findings and revise the estimate where assumptions fail. Authorize the next scope only when the team can demonstrate the required customer matching, financial results, response contract, and transaction outcomes. That decision creates a defensible starting point for the larger migration plan.
Database modernization Estimate your PostgreSQL migration work Mad Devs can help review one production workflow, trace its SQL and application dependencies, and define the manual work and acceptance checks for a pilot. Bring a target PostgreSQL version and one critical workflow so we can discuss where to start. Plan migration work |







