This post assumes you are running an m-Power version of October 2020 or later, as shown here.
As developers create applications in m-Power, metadata (data about their applications) are stored in an embedded Derby database that is installed on the m-Power server. In the past when developers have wanted to restore the application specifications of one application, there was not a way to do so without restoring the whole Derby database from a previous backup. This meant if you edited five application specifications one day, and the next day wanted to revert the application specifications of just one of those applications, you would have to restore the previous day’s backup and revert the changes made to all five applications.
As of the October 2020 update, developers can restore the application specifications of just one single application if needed. These specifications include, but are not limited to, the Data Model (Tables/Fields, Dimensions, Filters, Calculations), Template Properties, Smartlinks, and External Objects.
This example and steps that follow will assume the application I want to restore a prior version of is Retrieval #1 in a dictionary MRCTRAIN20 (MRCTRAIN20.I00001s).
- Find the desired backup file
- Restore the backup JSON file
- Recompile the application
Each time an application is compiled, a JSON file with a blueprint of all your application specifications is written to a folder on the m-Power server in /m-power/mrcwebgui/WEB-INF/specs/DD/#####/:
Sorting by the date modified, the file with the most recent date (in this case 10/29/2020) is the current application specifications. The JSON file from the previous day (10/28/2020 at 4:28PM) contains the application specifications I want to restore.
Copy the JSON file from Step 1, and paste it into the /m-power/mrcjava/WEB-INF/classes/DD/ folder:
The existing version (highlighted in yellow) must be overwritten. I will delete this existing ‘I00010s.json’ file, and rename my backup (highlighted in blue) to this same name.
Once the file on the server has been restored, the final step is to recompile the application. In the m-Power development UI, I’ll find my app in the Application Listing and edit it. Press the ‘Build App’ and recompile the application.
Note: Restoring a prior JSON file will not overwrite any existing m-Painter (HTML) customizations, granted you say ‘No’ to overwriting the HTML presentation layer when recompiling. If you need to restore a specific previous version of your HTML painting, this can be done using m-Painter’s versioning feature.