🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Use SqlServer with MDriven Turnkey
This page was created by Wikiadmin on 2026-07-29. Last edited by Wikiadmin on 2026-07-29.

You can move an MDriven Turnkey site from its default SQLServer CE (SQLCompact) database to SQL Server, including SQL Server in Azure, by changing the MDrivenServer model-version connection and then uploading the model to create a new schema.

Before you begin

This procedure changes where the application stores its data. When you point the application to a new SQL Server database, that database is empty until MDriven creates its schema.

Important: The schema-creation procedure below requires you to delete all model versions from MDrivenServer. Treat this as a destructive operation. Keep a local copy of the model in MDriven Designer before you begin.

You need:

  • Access to the MDrivenServer administration site. For a Turnkey site, this is typically available at https://<your-site>/__MDrivenServer.
  • MDrivenServer administrator credentials. For portal-managed sites, obtain the credentials from MDriven Portal.
  • A SQL Server connection string that includes the database user name and password.
  • The current model available locally in MDriven Designer.

For installation and initial Azure configuration, see HowTos:Install MDriven Server and Turnkey on Microsoft Azure.

Change the database connection

  1. Sign in to your MDrivenServer administration site.
  2. Open AdminArea and then Model Version Administration.
  3. Select the model version named A0.
  4. Select Pause to stop the application while you change its database connection.
  5. Change ConnectionType to SqlServer.
  6. Paste the SQL Server connection string into the connection-string setting. The connection string must include the SQL Server user name and password.
  7. Select Start to start the application with the new connection.

At this point, Turnkey uses SQL Server instead of the default SQLServer CE database. If the SQL Server database has not previously been used by this model, it contains no MDriven schema and no application data.

Create the schema in the new SQL Server database

MDriven creates the schema when it uploads a model and finds no earlier model version to evolve from.

  1. In MDriven Designer, confirm that you have the model locally before deleting anything on the server.
  2. In MDrivenServer, return to AdminAreaModel Version Administration.
  3. Delete every version of the model. The version list must be empty; do not leave an older version behind.
  4. Upload the model from MDriven Designer to MDrivenServer.
  5. Allow MDrivenServer to process the upload. Because no old model version remains to evolve, MDrivenServer recreates the database schema in the SQL Server database selected above.

Example

If your Turnkey site previously used its default local SQLServer CE database and you change ConnectionType to SqlServer, the site no longer reads the old local database. After you remove all server-side model versions and upload the model again, MDrivenServer creates the tables and schema required by that model in the configured SQL Server database.

Verify the change

  1. Open the Turnkey application after the model upload completes.
  2. Confirm that the application starts and can load its Index ViewModel.
  3. Confirm in SQL Server that the target database now contains the schema created for the uploaded model.

Troubleshooting

Symptom Check
The application cannot access the database. Verify that ConnectionType is SqlServer and that the connection string includes the correct SQL Server user name and password.
The application starts against SQL Server but has no schema. Confirm that all model versions were deleted before you uploaded the model. MDrivenServer must find no prior model to evolve from in order to recreate the schema.
You cannot sign in to MDrivenServer. Confirm the MDrivenServer URL and administrator credentials. See HowTos:Installing MDriven Server on Windows for MDrivenServer administration-site access and initial user setup.

See also