Recovery of Microsoft Dynamics NAV 2009 R2 and SQL Server
🧩 Original Environment
- ERP: Microsoft Dynamics NAV 2009 R2 (version 6.00.32012)
- Database: SQL Server 2008 R2 Express (32-bit)
- Server: Windows Server 2022 Datacenter (virtual machine)
- NAV Client: Classic and RTC
-
Database restored: Existing
.mdf
and.ldf
files from the previous instance
⚠️ Issues Found
- SQL Server 2008 R2 x86 did not start
Key ERRORLOG messages:
- TDSSNIClient initialization failed with error 0x139f
- Unable to initialize SSL support
- security.dll missing or corrupt
Dependency Walker showed multiple missing dependencies (API-MS-WIN-CORE-*
).
- Repair and installation of SQL Server 2014 failed
The installation returned errors in critical services (Database Engine, Reporting Services, etc.).
After repair and reboot, the service could not start due to encryption errors (schannel.dll
, bcrypt.dll
, etc.).
- SQL Server 2014 started but with severe errors
It searched for .mdf
and .ldf
files in internal build paths like:
E:\sql12_main_t.obj.x86Release\sql\mkmastr\databases\mkmastr.proj\
This caused the service to shut down automatically.
🔄 Change of Strategy
The following steps were decided:
- Completely uninstall SQL Server 2014.
- Install SQL Server 2008 R2 (x64).
- Manually restore the databases from the
.mdf
and.ldf
files.
🔧 Actions Taken
SQL Server
Executed:
CREATE DATABASE [DBName]
ON (FILENAME='...mdf'), (FILENAME='...ldf')
FOR ATTACH;
Confirmed data paths in:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA
NAV and Extended DLL
- Copied
xp_ndo_x64.dll
intoC:\Windows\System32
. - Executed:
EXEC sp_addextendedproc 'xp_ndo_enumusergroups', 'xp_ndo_x64.dll';
NAV License
- Loaded manually from the Classic client: Tools > License Information > Import
- The old license only allowed 2 companies. After importing the correct license, this was fixed.
🔐 Permissions and Errors Fixed
Initial errors:
❌ xp_ndo_enumusergroups
– access denied
❌ VIEW SERVER STATE
– required by the NAV client
Solution:
-- For a specific user
GRANT EXECUTE ON xp_ndo_enumusergroups TO [DOMAIN\user];
GRANT VIEW SERVER STATE TO [DOMAIN\user];
-- Or for all users:
GRANT EXECUTE ON xp_ndo_enumusergroups TO [public];
GRANT VIEW SERVER STATE TO [public];
🧪 Connectivity from NAV Client
- Classic client connected successfully from the server.
-
From other machines, it failed due to:
- Closed port
- SQL Browser service stopped
- User without permissions
Checked configuration and confirmed client used:
SERVER:7046/DynamicsNAV
Instance was accessible after fixes.
✅ Final Result
- Complete recovery of SQL Server 2008 R2 x64 instance.
- NAV runs correctly from Classic and RTC clients.
- All databases restored with their original license and fully functional users.
📁 Files Used
-
NAV2009R2_Data.mdf
/NAV2009R2_log.ldf
(NAV database) -
xp_ndo_x64.dll
(required extended procedure) -
.flf
NAV license file
🛠️ Recommendations
- Always back up
.mdf
,.ldf
, and.flf
license files. - Document the exact recovery process for future failures.
- Avoid newer SQL Server versions with NAV 2009 unless compatibility is guaranteed.
- Ensure ports and services (SQL Browser, SQL Server) are always active.