You can repair the administrative mapping in a corrupted self-managed MDrivenServer database when an evolution fails after deployment, using the mapping from a database at the same version.
When to use this procedure
Use this procedure when the MDrivenServer administrative database appears to be corrupted between deployments and cannot evolve correctly. The database file is:
__MDrivenServer/App_Data/DatabaseCompact.sdf
This procedure transfers the admin_ECO_ORMAPPING data from a known-good Compact database into the affected database. admin_ECO_ORMAPPING is the administrative mapping data used by the server for evolution.
Do not use this procedure as a general password-reset or configuration procedure. For access problems, see Documentation:MDrivenServer, Lost password or locked out. For general server maintenance and database transfer guidance, see HowTos:Configure and Maintain MDriven Server.
Before you begin
- Stop the MDrivenServer web application before copying or replacing its database. On a Windows IIS installation, stop the web server in IIS Manager.
- Obtain a copy of the affected
DatabaseCompact.sdf. Keep the original file unchanged as a rollback copy. - Obtain a known-good Compact database from the same MDrivenServer/database version as the affected database. A database from the same version is required because its mapping must match the version the affected server is trying to use.
- Keep both files clearly named. For example:
DatabaseCompact-corrupt-backup.sdf— untouched copy of the affected database.DatabaseCompact-good-same-version.sdf— known-good donor database.
If you are working with a local server installation, confirm that you are using the database from the intended installation. Documentation:LocalServers describes the local-server database locations and how they can change after a folder move.
Repair the mapping
Use the repair utility found in the MDriven source tree:
C:\CapableObjectsWush\source\AppCompleteGeneric\AppCompleteGenericFixCorruptAdminDB\
The utility works with two Compact databases:
| Database | Purpose in the repair |
|---|---|
| Known-good database | Source of the correct ECO_ORMAPPING value.
|
| Affected database | Destination database that receives the mapping. |
- Start the repair utility.
- Select or open the known-good database.
- Read its
ECO_ORMAPPINGvalue into the utility's text box. - Select or open the affected database.
- Write the
ECO_ORMAPPINGvalue from the text box into the affected database. - Save the changed affected database file.
The tool's intended workflow is to read ECO_ORMAPPING from one Compact database into its text box, then write the text-box value to the second Compact database.
If no matching donor database is available
A known-good database at the same version is the preferred source. If none is available, the tool permits you to inspect and edit the mapping text before writing it to the affected database. Do not apply a mapping from an arbitrary version: a version mismatch can leave evolution unresolved or introduce a different mapping problem.
Preserve the original affected database before making any manual change. The exact mapping content required for a particular version must be confirmed before you write it to the database.
Put the repaired database back
- Confirm that MDrivenServer remains stopped.
- Replace the affected server's
__MDrivenServer/App_Data/DatabaseCompact.sdfwith the repaired copy. - Retain the original backup outside the active
App_Datafolder. - Start the website or IIS again.
- Check whether the deployment/evolution now completes.
- Review the MDrivenServer log for the original error and for the result after restart. See Documentation:MDrivenServer log and Documentation:Debugging MDrivenServer Serverside actions.
Example
Assume deployment to a self-managed server fails because its administrative database will not evolve:
- Stop the IIS application hosting MDrivenServer.
- Copy
__MDrivenServer/App_Data/DatabaseCompact.sdfto a safe backup location. - Find a known-good
DatabaseCompact.sdffrom the same versioned database. - In
AppCompleteGenericFixCorruptAdminDB, readECO_ORMAPPINGfrom the known-good file. - Write that mapping into the copy of the affected file.
- Put the repaired file back at
__MDrivenServer/App_Data/DatabaseCompact.sdf, start IIS, and inspect the server log.
