Skip to main content

Part A — Windows Boots, Service is Down


In this case you can work directly in Windows Explorer or a command prompt. The database service does not need to be running to copy the files.


A1 — SQL Server: Locate and Copy the Files​

SQL Server databases consist of up to three file types, all of which you need:

FileExtensionContains
Primary data file.mdfThe database schema and data
Secondary data file.ndfOverflow data (not always present)
Transaction log.ldfTransaction history

Default file locations by SQL Server version:

VersionDefault Data Path
SQL Server 2012C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\
SQL Server 2014C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\
SQL Server 2016C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\
SQL Server 2017C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\
SQL Server 2019C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\
SQL Server 2022C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\
SQL Server 2025C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\

Steps:

  1. Open Windows Explorer and navigate to the data path for the installed SQL Server version (see table above).
  2. Identify the files belonging to the target database. They will be named after the database, e.g. ClientDB.mdf, ClientDB_log.ldf.
  3. Copy all three file types (.mdf, .ndf if present, .ldf) to your USB drive. Do not rename them.
  4. Verify the copy completed without errors before ejecting the USB.

Notes:

  • Custom paths: The client may have installed SQL Server with a non-default data path. If the files are not in the paths above, check the Windows Registry at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<instance>\MSSQLServer Look for the DefaultData and DefaultLog keys.
  • Do not try to copy the system databases (master, model, msdb, tempdb). Only copy the client's user database files.

A2 — PostgreSQL: Locate and Copy the Files​

PostgreSQL stores all databases in a single directory called PGDATA. Unlike SQL Server, you do not copy individual files — you copy the entire data directory.

Default file locations by PostgreSQL version:

VersionDefault Data Path
PostgreSQL 12C:\Program Files\PostgreSQL\12\data\
PostgreSQL 13C:\Program Files\PostgreSQL\13\data\
PostgreSQL 14C:\Program Files\PostgreSQL\14\data\
PostgreSQL 15C:\Program Files\PostgreSQL\15\data\
PostgreSQL 16C:\Program Files\PostgreSQL\16\data\

Steps:

  • Open Windows Explorer and navigate to the data folder for the installed PostgreSQL version (see table above).
  • Copy the entire data folder to your USB drive. This single folder contains everything needed.
  • Note the PostgreSQL version number from the folder path — you will need it when restoring.

Notes:

  • Note the version. For each database in the cluster there is a subdirectory within PGDATA/base, named after the database's OID. Because these internal identifiers are version-specific, the data directory must be restored on a machine running the exact same PostgreSQL version.