Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
VolkerSaggau
Product and Topic Expert
Product and Topic Expert

Potential use cases are:

  • Overwrite corrupt, broken or otherwise unusable HDI design time files in your project with their last successfully deployed versions.
  • Populate a project's database module with HDI design time files as they are currently successfully deployed in the HDI container.
  • Understand the content of an HDI Container without any source code (design time) be stored in GIT

 

Prerequisites:

  • Business Application Studio project with a HANA database module.
  • HDI container available via Cloudfoundry service of type "hdi-shared".
  • Database module bound to the "hdi-shared" service.

 

Detailed instructions on how to use the Artifact Recovery Wizard when working in Business Application Studio can be found in SAP Note 3269751 and the SAP Help Portal ("Restore Design-time Artifacts from the Database").

 

The Artifact Recovery Wizard is considered an expert tool and should be used carefully:

  • The Artifact Recovery Wizard reads and, if selected, restores the HDI designtime files in their last successfully deployed version. It cannot restore versions of files for which the deployment failed, as they are not part of the corresponding container filesystem.
  • Status "modified" means that a file exists in both BAS project and HDI container and the file versions differ. As there is no further information provided about which version is newer the decision which files with this status are eventually restored should be taken with care.
  • The Artifact Recovery Wizard was not designed to synchronize changes across multiple projects deploying into the same HDI container. Such a scenario carries an increased risk of unintentional object corruption and data loss and is therefore not recommended.

How to use Artifact Recovery?

Using BAS/HANATools:

1.) Create a new project (in my case "LostWorkspace") and bind it to the HDI-Container your want to recover.

"SFlight" in my case.

Notice that there are no sources (src folder) 

VolkerSaggau_0-1714231280690.png

Now press F1 or SHIFT+OPTION+P (on a MAC)

VolkerSaggau_1-1714231466367.png

and type now "Recover"

VolkerSaggau_2-1714231564398.png

and select SAP HANA: Start Database Artifact Recovery:

Choose the directory where you have your .env file located

VolkerSaggau_3-1714231753732.png

  • The wizzard will warn you in case that directory does not contain the .env file or
  • fill immediately the list with all objects in that container

VolkerSaggau_4-1714231945316.png

  1. select all file
  2. hdiconfig is by default in your project. By default overwrite the existing one with the older one from the project that was deployed before. There are reasons to keep the file. This is another discussion. Anyhow nothing onw can mend later as well.
  3. the list shows the "lost" missing object in your project.
  4. Check all the get the project back.

at the end of the list you can find the "Continue" bottom

VolkerSaggau_5-1714232333743.png

The result:

VolkerSaggau_6-1714232503810.png

  1. A backup of the existing content (nicely done by the developer not to overwrite existing version)
  2. All the objects that are inside the container. In my case I recovered a CAP project. That is why we have a "gen" folder.
    1. This was intentional to show: A reverse of the HDI does not give you back all your source code. Just the bit that is used in the database to generate the DB artifacts.
    2. The CAP CDS has some smart generation concepts. Is is a logical data model. You will not get this back by recovery. THIS METHOD is not a replacement for a proper GIT repository!
    3. It is very good for your own HDBTABLE, HDBVIEW, HDBCALCULATIONVIEW etc.

Do not forget to UNBIND the HDI Container now unless you are sure you want to overwrite the content. Recommendation to create a new HDI-Container now to continue.

Summary:

If for any case you want to look into an HDI Container and get back the source objects

ARTIFACT RECOVERY is your friend. It does not replace by any means a proper version system like GIT.

Hope you find this option helpful. Give it a try, so you known how to use this in emergency situations.

BR

Volker and Bastian