This post will describe how to preform a database downgrade on a Civil 3D 2015 survey database down to a Civil 3D 2014 survey database.
Civil 3D 2015 uses a SQL Server Compact 4.0 format, while Civil 3D 2014 uses a SQL Server Compact 3.5 format for the survey database Survey.sdbx file. If the 2015 file is downgraded back into a 3.5 file format, then it will be usable with Civil 3D 2011 through Civil 3D 2014 again.
Downgrading the SQL Server SDF Compact 4.0 File
There are many ways to downgrade an .SDF file. This method will use two small utilities, SqlCe40Toolbox.exe and LINQPad to downgrade the .SDF file. Note that these utilities are created by others and are subject to change.
SQL Server Compact 4.0 Toolbox – Survey Database Downgrade Save SQL Script
- Browse to the location of your survey database and copy the Survey.sdbx file.
- Rename the file to Survey2015.sdf.
- Download and run SqlCe40Toolbox.exe.
- Right-click on the text that says No SQL Server Compact Data Connections found, select Add from the context menu to add one.
- Click Add SQL Server Compact 4.0 Connection.
- Click Browse.
- Select the Survey2015.sdf file.
- Click Close.
- Right-click Survey2015.sdf, point to Script, click Script Database Schema and Data.
- Save the file as Survey2015Script.sqlce.
- Click OK twice.
- Close the SQL Server Compact Toolbox for runtime 4.0 application.
LINQPad – Survey Database Downgrade Run SQL Script
- Download and install LINQPad.
- Launch LINQPad.
- Click Add connection.
- Select Build data context automatically.
- For the LINQPad Driver, select Default (LINQ to SQL).
- Click Next.
- For the Provider, select SQL CE 3.5.
- Manually type the path to create the database .sdf file such as:
- Click Create database.
- Click OK.
- In the File menu, click Open.
- For the file type, select All Files (*.*).
- Select the Survey2015Script.sqlce file created from the SQL Server Compact Toolbox.
- Click Open.
- For the Language, select SQL.
- For the connection, select Survey2014.sdf.
- Click Execute, or press F5.
- Wait until it is finished Executing and it says Query successful, it may take a long time depending on the size of your database.
- Now that it is finished, you can close LINQPad.
You should now have an SQL Server Compact 3.5 database that you can use in the older versions of Civil 3D. Rename the Survey2014.sdf file to Survey.sdbx and replace your version of the Survey.sdbx file in your survey database folder and you should now be able to use this file in Civil 3D 2011 through Civil 3D 2014.