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

You can move data from an application running with XML persistence into an application running with MDrivenServer persistence by exporting a migration file and then importing that file into the target persistence.

What this procedure moves

This procedure uses the Migrate tool to transfer the objects and relations currently stored in an XML persistence file to MDrivenServer persistence.

The migration file is an intermediate file. You create it while the application runs against the XML source, then read it while the application runs against the MDrivenServer target.

For example, if your XML-backed application contains 24 objects and 22 relations, the import confirmation can report that it created 24 objects and set 22 relations in the target persistence.

Stage Persistence in use Migrate action Result
Export XML file Read the source data and write a migration file A file such as migrateToDB.xml contains the data to transfer.
Import MDrivenServer Read the migration file and save its contents The objects and relations are written to MDrivenServer persistence.

Before you start

  1. Ensure that you can start the application with its existing XML persistence and that the source data is present.
  2. Ensure that MDrivenServer persistence is configured and available as the target. For database connection and production setup guidance, see Documentation:Configuring Production Databases PostgreSQL MySQL MSSQL.
  3. Choose a location and name for the migration file, for example migrateToDB.xml. Keep the file available until the import has completed and you have verified the target data.
  4. Treat the XML source data as the source of record until you have verified the imported data.

Export data from XML persistence

  1. Start the system using XML persistence.
  2. Select Migrate.
  3. In the Migrate dialog, select the green action button. This loads the data from the XML persistence and writes it to a migration file.
  4. When prompted for a file location, save the migration file. For example, save it as migrateToDB.xml.
  5. Wait for the export to finish, then close the Migrate dialog.

At this point, the migration file contains the data read from the XML source. It has not yet been written to MDrivenServer persistence.

Import data into MDrivenServer persistence

  1. Change the application's persistence setting to MDrivenServer persistence.
  2. Start the system against MDrivenServer persistence.
  3. Select Migrate.
  4. In the Migrate dialog, select the pink action button to read a migration file.
  5. Choose the file created during export, for example migrateToDB.xml.
  6. Review the completion message. It reports how many objects were created and how many relations were set.
  7. Select the yellow action button to save the imported changes to MDrivenServer persistence.

Verify the migration

After saving, check that the expected data is available when the system runs against MDrivenServer persistence.

  • Confirm that expected objects are present. For example, compare the number of imported objects reported by Migrate with the data you expect from the XML source.
  • Confirm that related data is connected. The completion message reports relations separately, so an object count alone does not confirm that relations were restored.
  • Keep the XML source and migration file until you have completed this verification.

Scope and alternatives

This workflow transfers data through a migration file from XML persistence to MDrivenServer persistence. It is not a procedure for importing an existing third-party SQL database or for reverse-engineering its schema.

Walkthrough

Watch the migration walkthrough for a demonstration of exporting XML data to a migration file and importing it into MDrivenServer persistence.

See also

Data migration workflow

Data migration workflow

The Migrate tool can move data between persistence options. The video describes using it when data must be moved between XML files, local or cloud databases, or other configured persistence targets.

The workflow is intended for moving a manageable amount of data. It is not intended for millions of objects. When working with a larger database, the tool can use a cap value to export a subset of the data.

Before you begin

  • Back up application and user data before starting a migration.
  • Start the system against the source persistence before exporting data.
  • Choose the target persistence before importing the migration file.
  • Do not import a migration file back into the source store unless duplicate objects are intended. The video states that imported objects are treated as new.

Export data

  1. Start the system against the source persistence.
  2. Open Migrate.
  3. Export the data to a migration file. The demonstrated migration file is an XML file.
  4. Save the migration file in a location available to the target environment.

During export, the tool processes classes and their associations. The video also states that delayed-fetched attributes are fetched efficiently during this process.

Import data into a different persistence target

  1. Close or stop the session that is running against the source persistence.
  2. Configure and start the system against the target persistence.
  3. Open Migrate.
  4. Read the migration XML file into the current target persistence.
  5. Save the imported data to the target persistence.
  6. Verify the imported data in the application or debugger.

The video demonstrates this general approach for XML persistence and for database targets. It also demonstrates creating schemas for SQLite and SQL Server Compact before loading a data dump into those targets.

Scope

This workflow concerns moving data between persistence stores. The supplied sources do not document a general procedure for handling database schema changes after model changes. Use the applicable product documentation or obtain support before treating a data-dump import as a schema-evolution procedure.

For a product walkthrough, see MDriven | Data migration.