My use case is that I want to create a migration package which imports templates and other data types from the old and new package.
It seems to me that even if I use the old and new package as data-dependencies for the migration package, I cannot import into the migration package those data types which are not exported in the old and new packages.
Is this the case, or I am doing something wrong?
I would generally recommend against restricting exports in Daml since it can lead to a false sense of security. The expressions may not be exported in Daml but they are still exported in Daml-LF so you cannot rely on only the exported definitions being available.
That said, for data-dependencies that restriction shouldn’t apply (it goes through daml-lf so it inherits the behavior there). Do you have an example where you are unable to import a type?
Thank you, Moritz, you are right, there was some other problem.