Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to convert SQL Server 2008 mdf file to SQL Server Express version?

I have a mdf file which is SQL Server 2008 file. I want to convert it to SQL Server Express or SQL Compact edition.

Is there any tool to convert it ?

like image 442
AnyOne Avatar asked Dec 31 '25 11:12

AnyOne


1 Answers

For SQL Server - Express or Standard/Web/Developer - there is no difference in the file formats. Your MDF from your SQL Server 2008 will work on SQL Server 2008 (or 2008 R2) Express without any conversion or modification.

You can

  • create a backup from SQL Server 2008 (into a .bak file) and restore it under SQL Server 2008 Express

or:

  • you can detach the MDF file from your SQL Server 2008, copy the files to a new location (or new server), and then re-attach them to the SQL Server 2008 Express installed there.

The SQL Server Compact Edition is quite a different story, though - it's made up of a single .SDF file and cannot be easily created from an existing SQL Server 2008 MDF/LDF set of files.... I would be interested myself if there are any useful tools out there to migrate data from SQL Server 2008 (MDF/LDF) to a SQL Server Compact Edition 4.0 (SDF) format...

Update: a quickie search found a few interesting candidates:

  • SQL Server to SQL Server Compact Edition Database Copy Utility (CodeProject)
  • Primeworks Data Port Wizard
like image 158
marc_s Avatar answered Jan 02 '26 00:01

marc_s