Join our Newsletter — 33% off our NHI Course
Home› Guides› Database Platform Migration Playbook: Moving Engines Without Losing…
Guide Data Security

Database Platform Migration Playbook: Moving Engines Without Losing Security Control

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 15 min read
On this page

When an organisation moves a database from one engine to another, the data usually arrives intact while the security controls around it quietly do not. Logins, roles, row and column restrictions, encryption keys, audit policies and the service accounts of every connected application are engine-specific, so none of them transfer by copying tables. This playbook covers engine-to-engine moves: self-managed to managed service, one relational engine to another, or a relational engine to a different data model. It is vendor-neutral and written for database administrators, platform engineers and security architects who own the cutover. Schema change pipelines are covered in the Database Change and Schema Migration Security guide, and analytics platforms in the Data warehouse and lakehouse migration playbook; this page does not repeat them.

Key takeaways

  • Controls are migration objects. Inventory logins, roles, grants, row and column policies, encryption settings, audit policies and network rules with the same rigour as tables, and give each one a target design and a test.
  • Translate access by intent, not by syntax. Role, ownership and default privilege semantics differ between engines, so a mechanical grant conversion often widens access. Write what each role must be able to do, then build it natively on the target.
  • Every connection gets a new credential. Applications, replication jobs, reporting tools and administrators receive fresh, scoped credentials on the target; nothing is copied, and old credentials are revoked on a date.
  • Audit parity is a cutover gate. If the target does not log the same privileged actions and sensitive reads as the source, the migration has created a detection gap that will not show up in any functional test.
  • The source is still a full copy of the data. Replication slots, exports, staging buckets, snapshots and the old hosts stay sensitive until they are deleted or sanitised and the keys that protect them are destroyed.

What an engine migration actually moves

A table copy tool moves rows. Everything in the table below needs a deliberate decision, because each engine stores and enforces it differently.

ObjectWhy it does not transfer cleanlyMigration approach
Logins and authenticationPassword hash formats, integrated directory authentication and certificate login are engine-specific; hashes rarely importRebuild accounts on the target; move people to directory or token-based sign-in where the target supports it
Roles and grantsOwnership, inheritance, implicit grants to a public role and default privileges on new objects differExtract effective access, write intent per role, implement natively, test per persona
Row and column restrictionsRow-level policies, secure views and masking functions use different syntax and evaluation orderRe-implement and test with known users and known rows before data owners sign off
Stored codeProcedures, functions and triggers may run with definer rights, call the operating system or reach other databasesReview each for privilege mode and external calls; drop what is unused
Encryption at restTransparent encryption keys and column encryption keys are bound to the source engine or key storeEnable encryption on the target with new keys; plan re-encryption of protected columns
Encryption in transitServer certificates, enforced TLS settings and client verification settings live in engine configurationIssue a new server certificate, enforce encrypted connections, require clients to verify it
Audit configurationAudit policies, targets and event names are engine-specificMap each source audit event to a target event and log destination; prove it fires
Network access rulesHost-based access files, listener rules and cloud network rules are separate systemsRebuild from an allowlist of known clients, not from the old rule set
Links to other databasesLinked servers and database links often store a credential and trust pathRe-justify each; see the Database Links and Linked Servers guide
Scheduled jobsAgent jobs run under their own identity, often highly privilegedMove to an orchestrator with a scoped identity, or rebuild with least privilege

Choosing a migration pattern

The pattern decides how long two copies of the data coexist, which identities need write access to both, and how rollback works. Choose it with the security owner in the room, not only the application team.

PatternHow it worksChoose it whenSecurity trade-off
Offline dump and restoreStop writes, export, transform, load, switchSmall databases, an outage window is acceptableShortest dual-running period; the export file is a full plaintext copy unless encrypted
Bulk load plus change data captureInitial copy, then replicate ongoing changes until cutoverLarge databases, short outage toleranceA replication identity reads every change on the source, often with elevated rights, for weeks
Dual write by the applicationApplication writes to both engines during transitionRe-platforming one service at a timeApplication holds credentials for both; consistency bugs can leak or lose data
Strangler by domainMove tables or services in slices behind an access layerLarge estates, many consuming applicationsLongest coexistence; access policy must be kept in step across two engines
  • Small organisations: prefer offline dump and restore where the outage is tolerable. It keeps the number of temporary identities and copies low, and rollback is simply pointing back at an untouched source.
  • Large organisations: change data capture is usually unavoidable. Treat the replication identity as privileged: dedicated, scoped to the replicated objects, monitored, and removed on a fixed date.
  • Regulated data: confirm the target location, key custody and retention settings before the first byte moves, because the bulk load is itself a transfer of the full data set.

Translating access controls by intent

Engines disagree on details that matter: whether a public role has default rights on new objects, whether object owners can always read their objects, how role inheritance is resolved, and whether stored code runs as the caller or the definer. A literal translation of grant statements tends to over-grant, because tools resolve ambiguity by adding rights. Use this method instead.

  1. Extract effective access on the source. For each account and role, record what it can actually read, write, execute and administer, including rights gained through role membership and ownership. Flag accounts with no logins in the last 90 days as candidates for removal rather than migration.
  2. Write intent per role. One line each: "order service: read and write orders and order_lines, execute two procedures, nothing else". Data owners approve intent, not syntax.
  3. Remove default and public grants on the target first. Start from no access, then add. Check what the target engine grants to new objects by default and set default privileges explicitly.
  4. Implement natively. Use the target's role model, row policies and masking features. Where the target has no equivalent, move the restriction to a view or the application and record it as a judgement call.
  5. Test per persona. For each role, run allowed and denied queries as a test user and compare results with the source. A denied query that succeeds is a cutover blocker.

Separate administrative roles on the target from day one: a migration administrator, an operational database administrator, a security or audit role that can read audit configuration but not change data, and application roles. NIST SP 800-53 AC-5 (separation of duties) and AC-6 (least privilege) are the controls to evidence here. The target baseline should also follow the engine's CIS Benchmark and the Dangerous Database Features Guide, so operating system command, file access and external code features are off unless justified.

Where identity fits

Most of the risk in an engine move sits with non-human identities: application service accounts, replication users, ETL jobs, reporting tools and monitoring agents. They are numerous, rarely documented and often hold more rights than they use.

  • Inventory from logs, not from documentation: list distinct client accounts, source hosts and applications from the source's connection and audit logs over at least one full business cycle, including month-end jobs.
  • Reissue, never copy: each consuming application receives a new account on the target with its own credential, stored in a secrets manager, never in source code or a configuration file in source control, as the OWASP Database Security Cheat Sheet advises. Where the target supports token-based or directory authentication for workloads, use it; see How to use IAM database authentication.
  • One account per application and environment: development, test and production use separate accounts and separate databases, so a test credential can never reach migrated production data.
  • Scope the migration identities: the bulk load and replication accounts are the most powerful accounts in the project. Restrict them to known migration hosts, give them an expiry date, and alert on any use from elsewhere.
  • Retire on a date: source accounts are disabled at cutover plus a short rollback window, then removed. The Database Credential and Access Security Guide covers the steady state.

Leaked or reused database credentials are mapped in MITRE ATT&CK as T1078 Valid Accounts, and connection strings found in files as T1552.001 Credentials In Files. Migrations create both conditions: new connection strings are written into many configuration files at once, and old accounts linger.

Encryption and key handling

  • At rest: enable storage or transparent encryption on the target before loading data, with keys generated for the target and held in a key management service or hardware security module. Do not import source keys unless a protected column format requires it, and if it does, plan a re-key after cutover. Keys follow the lifecycle in NIST SP 800-57 Part 1: generation, active use, deactivation and destruction.
  • Column and application-level encryption: values encrypted by the application usually move as opaque bytes, which is safe, but check that the application's key reference still resolves in the new environment. Values encrypted by an engine feature must be decrypted and re-encrypted, which means plaintext exists during transformation: run that step on a controlled host with no persistent storage.
  • In transit: the bulk load, replication stream and every client connection use TLS 1.2 or later with server certificate verification, in line with the OWASP cheat sheet. Disable unencrypted listeners on the target rather than relying on client settings.
  • Export files and snapshots: encrypt every dump and staging file with a key dedicated to the migration, and destroy that key when the files are deleted. Destroying the key also renders forgotten copies unreadable.

The Database and Storage Encryption Guide explains how to choose between storage, transparent and column encryption on the target.

Audit parity

Functional tests will pass on a target that logs nothing. Build an audit parity matrix before cutover and treat any red row as a blocker.

Event classSource evidenceTarget requirementHow to prove it
Successful and failed loginsEngine login eventsSame fields: account, client host, time, resultGenerate a failed login as a test user; find it in the central log store
Privilege and role changesGrant, revoke, role membership eventsLogged with the acting accountGrant and revoke a test role; confirm both events
Schema and security object changesDDL eventsLogged, including policy and audit setting changesAlter a test table and disable a test audit rule; confirm both
Reads of sensitive tablesObject-level audit on classified tablesSame tables covered, mapped by the data classificationQuery a sensitive table as a test user; confirm the read event
Administrative sessionsSuperuser or administrator activityAll administrator sessions logged and alertedRun an administrator session from a jump host; confirm it reaches the SOC
Bulk exportExport utility and large result set eventsDetectable on the targetRun a controlled export; confirm the detection fires

Map detection rules too: queries written for the source's event names will silently match nothing on the target. MITRE ATT&CK T1213.006 (Data from Information Repositories: Databases) is the technique most rules here cover. The Database Audit Log Detection Guide covers the rules themselves; NIST SP 800-92 Rev. 1, currently an Initial Public Draft, frames log management planning across the whole log lifecycle.

The phased playbook

  1. Inventory and classify (weeks before): list objects, accounts, clients, stored code, links, jobs and data classes. Record which tables hold personal, payment or secret data.
  2. Design the target baseline: hardened configuration from the CIS Benchmark, network allowlist, encryption with new keys, administrative role separation, audit policy and log forwarding. Get security sign-off before any data loads.
  3. Build access by intent: roles, row and column restrictions and application accounts, tested per persona with synthetic or masked data.
  4. Load a non-production copy: use masked data where possible. Run access tests, audit parity tests and application tests together.
  5. Bulk load production: over an encrypted channel from a dedicated migration host, using the scoped migration identity. Start change capture if the pattern uses it.
  6. Validate: row counts and checksums per table, sample comparisons of sensitive columns, persona access diffs, audit parity matrix all green.
  7. Cut over: freeze writes on the source, apply final changes, switch connection endpoints, then revoke write access on the source. Keep the source read-only and isolated during the rollback window.
  8. Rollback, if needed: defined in advance with a decision owner and a deadline. Where writes have happened on the target, rollback needs reverse replication or a reconciliation plan; prove it once in rehearsal. NIST SP 800-34 Rev. 1 is a useful frame for the recovery plan.
  9. Decommission: remove replication identities and slots, revoke migration credentials, delete exports and staging copies, destroy migration keys, then sanitise or crypto-erase the old storage following NIST SP 800-88 Rev. 2 and keep the sanitisation record.

Restore test the target before declaring success: take a backup with the target's tooling, restore it to an isolated environment and confirm encryption, accounts and audit settings come back as designed. The Database Backup Security Guide covers backup encryption and immutability on the target.

Detection and measurement

During the project, monitor the migration identities closely: any login from a host outside the migration allowlist, any use after the planned end date, and any access to tables outside the replicated scope. After cutover, watch for failed logins from applications still pointing at old endpoints or credentials, which reveal consumers missed in the inventory.

MetricWhat it showsTarget (NHI Mgmt Group recommendation)
Access parity: personas whose allowed and denied tests match intentNo widened or broken access100% before cutover
Audit parity rows passingNo detection gap100% before cutover
Source accounts reissued or retiredNo copied or orphaned credentials100% within the rollback window
Migration identities still enabled after project endLingering high-privilege accessZero
Staging copies and exports without a deletion recordUncontrolled data copiesZero at decommission
Connections to the old endpoint after cutoverMissed consumersFalling to zero before source removal

Common failure patterns

  • Grant conversion that over-grants: an automated tool maps an ownership or implicit right to a broad grant, and every application account can now read every schema.
  • Row and column restrictions dropped: masking functions or row policies have no direct equivalent, so the data loads without them and nobody notices until a report shows full card numbers or another tenant's rows.
  • The shared migration superuser: one administrator credential is used for loading, replication and testing, pasted into scripts and chat, and never revoked.
  • Audit off "for performance": auditing is disabled during the bulk load and never turned back on, so the first months on the new engine have no trail of administrator or sensitive-read activity.
  • Forgotten copies: dump files on a jump host, a staging bucket, a replication slot and the old storage volumes survive long after go-live, each a full copy of production data.
  • Stored code with hidden privilege: definer-rights procedures or jobs are recreated under an administrator account, giving any caller indirect administrator capability.

Framework mapping

Migration activityNIST SP 800-53 Rev. 5NIST CSF 2.0
Inventory objects, accounts and data classesCM-8ID.AM-07
Impact analysis and controlled cutoverCM-3, CM-4PR.PS-01
Hardened target baselineCM-6PR.PS-01
Accounts, least privilege and separation of dutiesAC-2, AC-5, AC-6PR.AA-05
Credential reissue and retirementIA-5PR.AA-05
Encryption in transit and at rest, new keysSC-8, SC-28, SC-12PR.DS-01, PR.DS-02
Audit parity and log forwardingAU-2, AU-12PR.PS-04, DE.CM-09
Backup, restore test and rollbackCP-9, CP-10PR.DS-11
Delete copies and sanitise old storageMP-6, SI-12PR.DS-01

Practitioner checklist

  • Inventory accounts and client connections from source logs over a full business cycle, not from documentation.
  • Write access intent per role and get data owner approval before building target roles.
  • Strip default and public grants on the target, then build roles, row policies and masking natively.
  • Run allowed and denied tests per persona and block cutover on any mismatch.
  • Issue new, scoped credentials for every application, job and administrator; store them in a secrets manager.
  • Restrict migration and replication identities to named hosts and give them an end date.
  • Enable encryption at rest with new keys and enforce verified TLS for every connection before loading data.
  • Complete the audit parity matrix and port detection rules before cutover.
  • Rehearse rollback once, with a named decision owner and deadline.
  • At decommission, delete exports and staging copies, destroy migration keys, sanitise old storage and file the records.

Standards and references

Related NHI Mgmt Group resources: Database Security Guide · How to rotate database credentials without downtime · Service Account Security Guide · Database server health check · Cloud Migration Security

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.