How to migrate SDF database to Sql Server

Umbraco’s site installation comes with an SDF database. For obvious reasons, I needed to migrate this to SQL Server. Below are the steps I took to make it work.

Before proceeding to the steps below, you will need to install following:

  • ExportSqlCE40.exe which you can download from here
  • SQL Server Compact 4.0 Runtime from here

Steps to migrate:

  1. Navigate to the file system where your SDF file is
  2. Copy/Paste the ExportSqlCE40.exe into the same folder
  3. Open a command prompt and change directory to the same folder above
  4. Run the following command:
    ExportSqlCE40.exe "data source=INSERTDBNAMEHERE.sdf" database.sql
  5. You will then see a new file database.sql
  6. Open SQL Server Management Studio > Create a new database
  7. Run the database.sql against the new database you just created