The way to achieve that is by ensuring your filling has a water activity level slightly higher than that of the cake itself. Dry matter content plays a particularly important role in this regard. Knowing the water activity of your cake and filling is the first step towards migration control.