Mounting an External Drive (Windows)

If the failed Windows server still has intact drives, they can be attached to a new Windows server. Windows automatically recognises NTFS partitions — data can then be transferred directly.

Important — follow this order: Install the operating system on the new server completely before letting us know the old drives can be connected. If the drives are attached before the OS installation, the installer may detect the wrong disks and irreversibly overwrite the old data.

Overview

PhaseWhat happens
1. Detect the driveWindows detects the new drive automatically or via Disk Management
2. Assign drive lettersAssign drive letters to the old drive's partitions
3. Fix permissionsTake ownership of locked system folders from the old installation
4. Transfer dataCopy files, IIS config, and databases to the new server

Step 1: Detect and bring the drive online

Make the new drive visible in Disk Management.

Open Disk Management via Start → Run → diskmgmt.msc. The new drive appears in the lower list. If it shows as Offline, right-click it and select Online.

PowerShell
Get-Disk | Select-Object Number, FriendlyName, Size, OperationalStatus Set-Disk -Number 1 -IsOffline $false

Replace 1 with the actual disk number from the output.

Step 2: Assign drive letters

Assign drive letters to the old drive's partitions so they can be accessed.

Via Disk Management

Right-click a partition on the new drive and select Change Drive Letter and Paths → Add. Assign a free letter — e.g. D: or E:.

Via diskpart

PowerShell
diskpart list disk select disk 1 list partition select partition 1 assign letter=D exit

Step 3: Take ownership of system folders

Gain access to locked folders from the old Windows installation.
PowerShell
takeown /f "D:\Users" /r /d y icacls "D:\Users" /grant Administrators:F /t
PowerShell
takeown /f "D:\inetpub" /r /d y icacls "D:\inetpub" /grant Administrators:F /t

takeown /r works recursively and may take a few minutes on large directories.

Step 4: Copy web files and configuration

Transfer IIS web files, applications, and configuration to the new server.

Copy web files (IIS)

PowerShell
robocopy "D:\inetpub\wwwroot" "C:\inetpub\wwwroot" /E /COPYALL /R:3 /W:5

Export and import IIS configuration

PowerShell
appcmd list site /config /xml > D:\iis-export.xml appcmd add site /in < C:\iis-export.xml

Copy user directories

PowerShell
robocopy "D:\Users\YourUsername" "C:\Users\YourUsername" /E /COPYALL /R:3 /W:5

Step 5: Migrate SQL Server databases

Transfer SQL Server database files and attach them on the new server.
PowerShell
robocopy "D:\Program Files\Microsoft SQL Server\MSSQL\DATA" "C:\SQLBackup" /E /R:3 /W:5

Attach the copied database files in SQL Server Management Studio (SSMS): Databases → Right-click → Attach and select the .mdf file. Or via T-SQL:

PowerShell
sqlcmd -S localhost -Q "CREATE DATABASE MyDatabase ON (FILENAME = 'C:\SQLBackup\MyDatabase.mdf'), (FILENAME = 'C:\SQLBackup\MyDatabase_log.ldf') FOR ATTACH;"

Only copy SQL Server database files directly if both servers run the same or a newer SQL Server version. For older target versions use a backup/restore approach instead.

Step 6: Check services and settings

After the data migration, verify all relevant services and configurations on the new server.
1.Start IIS and verify all websites load correctly: iisreset /start
2.Check application pools in IIS — connection strings and database passwords may need updating
3.Review all Scheduled Tasks and recreate them on the new server
4.Check installed SSL certificates — they may need to be reimported

Step 7: Import SSL certificates

Import certificates from the old server and assign them in IIS.
PowerShell
Import-PfxCertificate -FilePath "C:\certificate.pfx" -CertStoreLocation "Cert:\LocalMachine\My" -Password (ConvertTo-SecureString "CertPassword" -AsPlainText -Force)

Assign the imported certificate in IIS: IIS → Website → Bindings → HTTPS → Select certificate.

Need help with the drive swap?

The physical installation of drives in our data centre must be carried out by our technical staff. Open a support ticket in the PowerPanel.