Duplicate a Project as a Template in Create Project Macro

Solved!
gblack686
Level 4
Duplicate a Project as a Template in Create Project Macro

I've set up a project creation macro. Now I want to copy over contents from a "template project". In the new project I'd like to include datasets, plugins, dss insights, dashboards, git history. 

I know there is a duplicate function, but from my understanding this duplicates project contents to a new project --- but the project will already have been created by the macro. 

0 Kudos
1 Solution
ManhulayS
Dataiker Alumni

Hello @gblack686,

Using a project creation macro, it is possible to directly create a new project by duplicating an existing project. 

To do so you can use these lines in your "runnable.py" file:

project = client.get_project('TEMPLATE_PROJECT')
project.duplicate('NEW_PROJECT', 'New project from template')

Please refer to the python API doc for further details:  https://doc.dataiku.com/dss/latest/python-api/projects.html#duplicating

View solution in original post

1 Reply
ManhulayS
Dataiker Alumni

Hello @gblack686,

Using a project creation macro, it is possible to directly create a new project by duplicating an existing project. 

To do so you can use these lines in your "runnable.py" file:

project = client.get_project('TEMPLATE_PROJECT')
project.duplicate('NEW_PROJECT', 'New project from template')

Please refer to the python API doc for further details:  https://doc.dataiku.com/dss/latest/python-api/projects.html#duplicating