{"id":10708,"date":"2020-10-30T07:20:51","date_gmt":"2020-10-30T13:20:51","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/techblog\/?p=10708"},"modified":"2023-08-08T12:02:05","modified_gmt":"2023-08-08T18:02:05","slug":"restoring-application-specifications-in-m-power","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/techblog\/?ht_kb=restoring-application-specifications-in-m-power","title":{"rendered":"Restoring Application Specifications in m-Power"},"content":{"rendered":"\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">One <strong>must <\/strong>be running any version of m-Power on or after the October 2020 update to utilize this document.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;s backup and revert the changes made to all five applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1. Find the desired backup file<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Every time an application is compiled, a new 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\/#####\/:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/techblog\/images\/app_restore1.jpg\" alt=\"JSON Files on the m-Power server\"\/><figcaption class=\"wp-element-caption\">Figure 1: The JSON files associated with an m-Power application.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Sorting by the date modified, the file with the most recent date (in this case 10\/29\/2020) is the current version of the application specifications. The JSON file from the previous day (10\/28\/2020 at 4:28PM) contains the application specifications I want to restore.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2. Restore the backup JSON file<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the JSON file from Step 1, and paste it into the \/m-power\/mrcjava\/WEB-INF\/classes\/DD\/ folder:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/techblog\/images\/app_restore2.jpg\" alt=\"JSON Files on the m-Power server\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The existing version (highlighted in yellow) must be overwritten. I will delete this existing &#8216;I00001s.json&#8217; file, and rename my backup (highlighted in blue) to this same name.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/techblog\/images\/app_restore3.jpg\" alt=\"JSON Files on the m-Power server\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3. Recompile the application<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the file on the server has been restored, the final step is to recompile the application. In the m-Power development UI, I&#8217;ll find my app in the Application Listing and edit it. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Press the &#8216;Build App&#8217; and recompile the application.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/techblog\/images\/app_restore4.jpg\" alt=\"JSON Files on the m-Power server\"\/><\/figure>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\"><strong>Note:<\/strong> Restoring a prior JSON file will <strong>not<\/strong> overwrite any existing m-Painter (HTML) customizations, granted you say &#8216;No&#8217; 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&#8217;s <a href=\"\/docs\/m-painter-app-prop\/using-m-painter-versions-to-restore-files\">versioning<\/a> feature.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview 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&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"closed","ping_status":"open","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[],"ht-kb-tag":[],"class_list":["post-10708","ht_kb","type-ht_kb","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/10708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10708"}],"version-history":[{"count":28,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/10708\/revisions"}],"predecessor-version":[{"id":12066,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/10708\/revisions\/12066"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10708"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-category&post=10708"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-tag&post=10708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}