You can restore the missing evolve script for the MDrivenServer administration database when its Evolve Script box is empty or its admin database cannot evolve after an update.
When to use this procedure
Use this page only when the administration database of MDrivenServer has lost, or has an incorrect copy of, the mapping information used to evolve that database. In the normal state, Read Current Evolve Script returns the evolve script from the last successful evolve.
A missing script is a known symptom of older MDrivenServer versions up to 2019-03-25. During an evolve of the MDrivenServer administration database, performed when MDrivenServer has an updated internal model, the script needed for future evolves could be erased. Without that script, MDrivenServer cannot evolve its administration database to later versions.
This is not the normal procedure for evolving an application database. For ordinary database evolution, see Documentation:Database evolve.
Check for automatic recovery first
MDrivenServer can restore a missing mapping file during startup.
- Locate
App_Data\MissingOrMapping.xmlin the MDrivenServer application. - Start MDrivenServer.
- If the administration database starts without its ORMapping (object-relational mapping) information and the file is present, MDrivenServer injects the file.
- After using the file, MDrivenServer renames it to
Used_MissingOrMapping.xml. This prevents the same file from being used again on a later startup.
The supplied recovery file is version 13500 of the script. Replace its contents only when the MDrivenServer version requires another mapping version.
Identify the failure state
The administration database stores its mapping information in Eco_Ormapping. The database schema and this mapping must describe the same current administration model.
| State | What it means | Result | Required action |
|---|---|---|---|
1. Eco_Ormapping is empty and the database schema is old
|
Both the mapping information and schema are behind. | Evolve cannot run. Repair moves the database only to state 2. | Restore the correct script, then evolve the administration database. |
2. Eco_Ormapping contains the newest mapping but the database schema is old
|
The mapping says the database is current, but the physical schema is not. | Evolve does not detect that it must update the schema; the administration interface does not start because the schema is old. | Restore the correct script, then evolve the administration database. |
3. The database schema is new but Eco_Ormapping is empty
|
The schema currently works, but the mapping record is missing. | You may see no error until a later evolve, when the server reaches state 1. | Use Repair admin evolve script. |
| Correct state | Eco_Ormapping describes the current database schema.
|
Future evolves can determine the required changes. | No repair is required. |
Restore a missing evolve script
Use this procedure for states 1 and 2, or whenever Read Current Evolve Script returns an empty text box.
- Open the MDrivenServer administration settings page.
- Select Read Current Evolve Script.
- Inspect the returned text. Stop if it already contains the expected script; do not overwrite it without determining why the evolve failed.
- Obtain the mapping XML that matches the MDrivenServer version:
- Version 2022-05-13 and later: File:OR-mapping version 20220513.xml.
- Version 13500, for 2021-10-12 through 2022-05-12: File:OR-mapping version 13500.xml.
- Versions 10923 through 13499, for 2019-04-03 through 2021-10-12: File:OR-mapping 10923 13499.xml.
- Open the downloaded XML in a text editor, not in a browser. The XML characters
<and>must be preserved. - Copy the complete XML text into the Evolve Script text box.
- Select Write Current Evolve Script.
- Select Read Current Evolve Script again. Confirm that it returns the script you wrote. Do not continue until this check succeeds.
- Run the administration database evolve again.
For example, if the script box is empty on a server running a version in the 13500 range, write the complete contents of OR-mapping_version_13500.xml, read it back to confirm it persisted, and then run the administration database evolve.
Repair a new schema with missing mapping information
Use this path only for state 3: the administration database schema is already new, but Eco_Ormapping is empty.
- Open the MDrivenServer administration settings page.
- Select Repair admin evolve script.
- Read the current evolve script afterward and confirm that the script is present.
Do not use this repair as a substitute for restoring the correct versioned script when the database schema is old. In states 1 and 2, write the matching script and then run Evolve admin DB.
Related symptoms and recovery options
If the error is Problem in portalpush Unknown valuetype in admin_ECO_ORMAPPING table (), the administration mapping information may have been cleared. Follow Documentation:Unknown valuetype to copy the current script from another MDrivenServer with the same current administration model.
If the administration database file itself is corrupt and does not evolve correctly, use Documentation:Corrupt MDriven Server rather than repeatedly attempting this script repair.
When investigating an evolve failure, use the administration log to correlate the evolve operation with its messages. Documentation:Debugging MDrivenServer Serverside actions explains how to inspect server activity and logs.
Prevent recurrence
- Verify an evolve after every MDrivenServer update by reading back the current evolve script and confirming that it is not empty.
- Before evolving a shared development server, notify other developers. They must obtain the updated model and rebuild before testing against the evolved database; see Documentation:MDrivenServer Slack web hook.
- Keep a matching MDrivenServer instance or database copy available when practical. A same-version server can provide a known-good administration mapping script for recovery.
