Server Management & Access

How can we help?

Guides and technical documentation for your Server4You dedicated server or VPS.

Mounting an External Drive (Windows)

If a failed Windows Server still has intact drives, our technicians can attach them to your new Windows Server. This guide shows how to access the NTFS partitions and transfer files, IIS sites and SQL Server databases.

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

Back up the IIS configuration

The IIS configuration of the old installation is stored in applicationHost.config. Copy it for reference and recreate sites, bindings and application pools on the new server — do not overwrite the new server's file:

PowerShell
New-Item -ItemType Directory -Path "C:\Migration" -Force Copy-Item "D:\Windows\System32\inetsrv\config\applicationHost.config" "C:\Migration\applicationHost.old.config"

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\MSSQL16.MSSQLSERVER\MSSQL\DATA" "C:\SQLBackup" /E /R:3 /W:5

MSSQL16 stands for SQL Server 2022 — adjust the folder name to your version and instance. 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;"

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
5.If you need registry keys from the old installation, load its registry file temporarily: reg load HKLM\OLD_SOFTWARE D:\Windows\System32\config\SOFTWARE — unload it after exporting with reg unload HKLM\OLD_SOFTWARE

Step 7: Import SSL certificates

Import certificates from the old server and assign them in IIS.

If the old certificates are available as a .pfx file, import them via PowerShell:

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.