🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
Moving the MDriven Server Admin Database to SQLite

This article explains how to move the MDriven Server admin database to SQLite.

All current clean installs of the MDriven Server use SQLite for the admin database by default.

Overview

To move to SQLite, you set up a clean install of the MDriven Server, which will use SQLite. Then you upload your model and data back into it. The exact steps depend on where your user data is stored:

  • Option A: Your user data is in the built-in VistaDB database.
  • Option B: Your user data is in an external database, such as SQL Server.

Phase 1: Preparation

Step 1: Back up your model

Back up the model currently running on the MDriven Server. You'll need it after the clean install.

You can back up the model in one of these ways:

WARNING: Don't continue until you have a backup of the model version that is running on the server. Without it, you can't restore your application after the clean install.

Step 2: Back up your user data

Before changing the server, secure your existing user data based on your setup:

  • If using VistaDB (Option A): Create an XML backup of the user data on your current MDriven Server. For instructions on how to do this, see MDriven Backup & Restore Guide.
  • If using an external database (Option B): Make a full copy of your external user data database before you change anything.

Step 3: Back up configuration files

Back up the MDriven Server configuration files. Specifically, make a copy of your CommandlineOverride file so your custom settings are safe.

Phase 2: Update MDriven Server & Switch to SQLite

Step 1: Update MDriven Server app files

Download the latest version of the MDriven Server from the MDriven Downloads page and update your server app files.

Note: Updating these files leaves your admin database and commandline settings intact.

Important: Because you are updating the MDriven Server files, you must also update your Turnkey app files from the downloads page to ensure both systems remain in sync.

Step 2: Remove the old VistaDB admin database

Navigate to your server's MDrivenServer/AppData folder and remove or delete the DatabaseVistaDB.vdb6 file.

By removing this file, you force the MDriven Server to create a brand new SQLite admin database the next time it starts up.

Step 3: Start the server and reset the "a" user password

Start the MDriven Server so it generates the new SQLite admin database.

Use the /AppData/PwdReset.txt file to reset the MDriven Server user "a" password otherwise the Turnkey will not be able to connect to the MDriven Server

Step 4: Restore configurations

Restore any custom configurations if you previously set up any in the MDriven Server, like Email Settings, Server Wide variables and MDriven Server users.

Phase 3: Restore Data and Model

Option A: Your user data is in VistaDB

  1. Upload your model: Log in to the server or use the MDriven Designer and upload the model you backed up in Phase 1.
  2. Restore your user data: Upload the XML user data backup you made in Phase 1.
  3. Restore settings: If your old MDriven Server had custom settings, apply them to the new MDriven Server.

Option B: Your user data is in an external database

  1. Connect to a dummy database: Connect the new MDriven Server to a dummy (empty, temporary) external database by updating the connection string in the MDriven Server UI. Don't connect your real database yet.
  2. Upload your model: Upload the model you backed up in Phase 1. This makes sure the new SQLite admin database has the current model version, which matches your real external database.
  3. Connect your real external database: Change the MDriven Server's database connection string from the dummy database to your real user data database.
  4. Upload the model again: Upload the model one more time. This is to confirm that the admin database is completely in sync with your external database.

See also