The India User Group is live! Be a part of our first Indian user event: JOIN THE EVENT

change DB connection with project duplication

Solved!
JasperStaal
Level 1
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
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

2 Replies
MarcH
Dataiker
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

JasperStaal
Level 1
Level 1
Author

Goodmorning,

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

 

0 Kudos
A banner prompting to get Dataiku DSS
Public