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

You can force MDrivenServer to create a new SQL database schema from your local MDriven Designer model by removing every deployed model version before you upload the model again.

When to use this procedure

Use this procedure when the database schema must be created again rather than evolved from an earlier deployed model version.

For example, after you configure a Turnkey application to use an empty SQL Server database, MDrivenServer has no existing schema to use. Removing all deployed versions ensures that MDrivenServer has no earlier model version to evolve from when you upload the model.

Warning: Deleting all model versions is the signal that causes MDrivenServer to recreate the schema. Treat this as a destructive deployment operation. Confirm that recreating the database is appropriate for your environment before you remove the versions.

Before you begin

  • Keep the model you intend to deploy available locally in MDriven Designer.
  • Make sure you can sign in to MDrivenServer.
  • Identify the application whose database schema you want to recreate. In MDrivenServer, the modeled database tables use the application prefix, such as A0_. MDrivenServer's own administrative tables use the Admin_ prefix; see Documentation:MDrivenServer, opening the built-in database.
  • If you are working with a Turnkey site, open the site's MDrivenServer page. The Portal provides the MDrivenServer user name and password there.

Recreate the schema

  1. Open MDrivenServer and go to AdminArea / Model Version Administration.
  2. Review the list of deployed model versions for the application.
  3. Delete every version in the list. Select a version, use the green check mark, and then choose Delete Version. Repeat until the list is empty and contains no models.
  4. Return to your local model in MDriven Designer.
  5. Upload the model to MDrivenServer.
  6. Allow MDrivenServer to process the uploaded model. Because no older deployed model version remains, MDrivenServer does not evolve from an old model; it recreates the database schema from the uploaded model.

Verify the result

After the upload completes:

  • Confirm that the new model version appears in Model Version Administration.
  • Start or open the application and verify that it can use the recreated schema.
  • If you inspect the built-in compact database, modeled tables are prefixed with A0_; administrative tables are prefixed with Admin_. See Documentation:MDrivenServer, opening the built-in database.

Example: an empty SQL Server target

When changing a Turnkey site from its default SQLCompact database to an empty SQL Server database, first configure the SQL Server connection and then use this procedure. The connection change makes the application target SQL Server, but it does not populate the empty database. Removing all model versions and uploading the model causes MDrivenServer to create the schema in that target database.

For the connection-type and application pause/start steps, follow HowTos:Use SqlServer with MDriven Turnkey.

Related database tasks

Recreating a schema is different from evolving an existing schema. If you need to retain and change an existing database through the normal model-evolution process, see HowTos:Evolve Database with Code.

If you are adopting an existing database rather than creating a new schema, use HowTos:Reverse Engineer a Database. If you need to bring data from another SQL Server database, see HowTos:Import Data from Other SQL Servers.

See also