change DB connection with project duplication

JasperStaal
JasperStaal Partner, L2 Designer, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 2 Partner

Hello,

We have multiple dataiku projects in a project folder (Development). These projects are connected to a database. We'd like to duplicate these projects to a new project folder (Acceptance) and with the duplication change the connections from the development database (DB_Dev) to the acceptance database(DB_Acc). Since we have multiple projects, the duplication takes a lot of effort when manually performed. I'm using a python code to automate this process. The duplication of the projects works as desired by using the project.duplicate() function, but the remapping of the connections is not performed while

  • remapping (dict) – dict of connections to be remapped for the new project (defaults to {})

is one of the parameters of the function. Our dict of connections is defined as {'DB_Dev': 'DB_Acc'}.

Can someone tell my why this doesn't work?

Thanks in advance.

Jasper

Best Answer

  • MarcH
    MarcH Dataiker Posts: 26 Dataiker
    Answer ✓

    Hello,

    The remapping parameter has a slightly more complicated format. For your case, try using the following:

    {'connections':[{'source':'DB_Dev', 'target':'DB_Acc'}]}

    I'll log a request to improve documentation for that duplicate method since it doesn't give much guidance on the format of the remapping parameter.

Answers

Setup Info
    Tags
      Help me…