Use existing named volume from deleted stack

Hi there. I understand that named volumes are scoped by stack. I removed a stack, and recreated it, and want to use the existing volume from the previous stack. The volume is still present on the host. Is there a standard way to reuse this volume?

Eg my volume is called “db_data” in my compose file. My old stack used the volume “staging_db_data_44d01”, but my new one is using “staging_db_data_821da”. I want to go back to the old one instead. (Those are volume names as listed in “docker volume ls” command).

Hmm you could use docker volume inspect db_data and then cd to the path and copy the data to the new docker volume.

I have a similar challenge. My intended solution is to only use the ‘In Service’ upgrade, and not the ‘Rolling Service’ upgrade so that id will not change. However I am very nervous about that and figure it will likely change at some point. I also plan to run regular database dumps as a normal backup process, and possibly some kind of clustering between containers running at different sites. Oh and one other solution I may use is rancher-nfs mount: Is it possible to directly map rancher-nfs subfolders as volumes?