Two strategies, both worth knowing
1. Native dump tools (preferred for databases)
For Postgres, MySQL, Mongo — use the database's own dump tool. Logical, portable, version-tolerant. pg_dump, mysqldump, mongodump.
2. Volume snapshot via temp container (works for anything)
Spin a temporary container with the volume and a host directory both mounted, tar the volume into the host directory. Crude, generic, sometimes the only option.