[text] d docker.fromenv for oldvolume in d.volumes.listfilterslabel fcom.docker.compose.projectoldproject newlabels oldlabels oldvolume.attrsLabels newlabels com.docker.compose.project newproject newlabels com.docker.compose.version oldlabelscom.docker.compose.version newlabels com.docker.compose.volume oldlabelscom.docker.compose.volume newvolume d.volumes.create nameoldvolume.name.replace oldproject newproject driveroldvolume.attrsDriver driveroptsoldvol. ttrsOptions labelsoldvolume.attrsLabels printnewvolume.name Im not sure if this is the best way to do this but it works for me.