How to retrieve deleted recipes?

Options
UserBird
UserBird Dataiker, Alpha Tester Posts: 535 Dataiker
Hello,

I removed a recipe by mistake, is it still possible to retrieve it?

Thanks,
Tagged:

Answers

  • jereze
    jereze Alpha Tester, Dataiker Alumni Posts: 190 ✭✭✭✭✭✭✭✭
    Options
    Hi Nicolas,

    There is no way to cancel a delete operation in DSS (as of version 2.1).

    However, the DATA_DIR/config directory is versioned with git. At your own risk, with the command line, you could try to restore a previous configuration.

    Jeremy
  • jrouquie
    jrouquie Dataiker Alumni Posts: 87 ✭✭✭✭✭✭✭
    edited July 17
    Options

    Hi,

    As said by Jeremy, DSS stores all configuration modifications in an internal git repository. This repository is not exposed in the GUI. Everything that follows is not officialy supported, so before touching anything in the git repository, backup the DATA_DIR.

    Any intervention on this git repository should be done with DSS stopped. If things go wrong, you must restore the DATA_DIR from the above backup.

    Alternatively, you could try this read-only (and thus safer) access to the git repository, to display the code this recipe used:



    cd DATA_DIR/config
    git log
    # look for the sha1 of the commit which deleted the recipe, for instance “commit 424242424242”
    # Quit this display by typing “q”
    git show --name-only 42424242 # where 42424242 is the beginning of above commit sha1
    # note the .py file containing the python code to recover, for instance projects/FOO/recipes/bar.py
    git show 42424242^:projects/FOO/recipes/bar.py
    # mind the starting circumflex: it asks git to look for this file in commit just before deletion

    This displays the deleted code. It should now be straightforward to recreate the recipe and copy paste the code.

    Hope this helps,

    Jean-Baptiste Rouquier

  • aalibasic
    aalibasic Registered Posts: 1 ✭✭✭✭
    Options
    I am raising this again in 2019, now it is possible to return this just go to the applied steps, click on the unique ID of the step and click retrieve this.
  • gblack686
    gblack686 Partner, Registered Posts: 62 Partner
    Options
    How do you access this shell? I used a Notebook to cd into the config folder but the git log command does not work. ( I'm attempting to retrieve a 'Custom Plugin' that I deleted )
  • ashishmalhotra
    ashishmalhotra Dataiku DSS Core Designer, Registered Posts: 1
    Options

    2023 update:

    GO to your homepage project , in version control and there you will get all changes . Like deleted recipes , datasets . Redo by code again , because there are some conflicts with reverting the changes from there.
    https://doc.dataiku.com/dss/latest/collaboration/version-control.html#viewing-history

Setup Info
    Tags
      Help me…