change DB connection with project duplication

Solved!
JasperStaal
Level 1
change DB connection with project duplication

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

0 Kudos
1 Solution
MarcH
Dataiker

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.

View solution in original post

4 Replies
MarcH
Dataiker

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.

JasperStaal
Level 1
Author

Goodmorning,

This solution did work and gave the desired result! Thanks for the fast reply, @MarcH!

 

0 Kudos
lucifer20
Level 1

Hi, Can anyone please tell me the mapping for Code Environments as well?

0 Kudos
Turribeach

Hi. Please start a new thread. This thread has been masked as resolved already. Thanks 

0 Kudos