I'm trying to remove all unnecessary connections in ArcGIS Pro with ArcPy. I'm running a script which picks up ArcGIS Pro Project template and makes a copy. Then adds new database and toolbox and makes these things as the default ones. But when I open newly created ArcGIS Pro aprx, database, toolbox and folder connection from template are still there. How can I remove them?
Part of my script:
import arcpy
aprx = arcpy.mp.ArcGISProject("path to template") #path to ArcGIS Pro template
database=arcpy.CreateFileGDB_management(Path,Name) #create database
aprx.defaultGeodatabase=database #set default database
aprx.homeFolder="Path to folder" #set default folder connection
aprx.saveACopy(new.aprx)