Skip to content

Partial model recovery

Jean-Baptiste Sarrodie edited this page Mar 4, 2024 · 1 revision

In some occasions, it might be handy to recover some views from a previous version of a model or a local copy made while solving an incident. This is an easy operation that can be done using the model merge feature of Archi and a jArchi script:

If you want to recover from a local backup of the model, open it. If you want to recover from a previous version, go to the Change History tab (if you can't see it, open it using the Collaboration > Toggle Change History menu), then right clic on the version you want to recover from, and select Extract model from this commit.

coarchi-extract-model

Tip

Once done, to avoid any mistake, it is recommended to rename the model so that it is explicit that it is the backup model.

In this model, move all the views that you want to recover at the top-level Views folder. Then delete all the other views and folders.

Now that your Backup model only contains the needed views, right clic on the model name, then (from the contextual menu) run the script Delete unused elements and relationships. As its name implies, this script will remove all elements and relationships, except those used in the remaining views (this script can be found here). Don't forget to save the model after the script has run.

jarchi-delete-unused

The next step is to import this model into the target:

  1. Make sur the target model is opened and selected in the model tree
  2. Go to the menu and select File > Import > Another Model Into Selected Model... archi-model-merge
  3. Clic on the Choose... button and select your Backup model
  4. Make sure Update existing objects and folders and Show Status Dialog after importing are selected
  5. Make sure Update model information and top-level folders is not selected
  6. Clic on the Import button

In the status dialog window that will be shown after the import, you should see only informations. If you see some warnings, an in depth review of the model will be needed. So, in this case, copy the messages into the clipboard and then in a text editor so you have them available after having closed the dialog window.

The last step is the review phase: open the views which have be recovered and check they are fine. They should be easy to find as they will have been moved at the top-level Views folder. If you had any warning, check each of them to decide whether or not the recovery was successful. When done, you can move the views back into the right folders, and then save the model.

Note

If the model was managed using the collaboration plugin, don't forget to publish this new version using an explicit commit message.