While I'm not familiar with that specific switch, there's basically two or three scenarios:
- The switch configuration is wiped on both switches when you enable stacking.
- The switch configuration is preserved on the first, "master" switch when you enable stacking, and wiped on the following "slave" switches.
- The switch configuration is preserved after enabling stacking on both switches.
HP 2920 switches for example follow scenario 2, where the master switch configuration is preserved, but any slave switches get a complete wipe. This is quite logical, as the master switch stores the configuration for all switches in the stack, and as such has no configuration for the ports on the slave switches.
Another thing to keep in mind is if your switches are "true" stacking switches, or "pseudo-stacking". Most HP switches for example has a "stacking" feature, but it doesn't do much more than allow management from a singular IP for all the switches in the stack. The aforementioned 2920 series on the other hand has "true" stacking, where the switches in the stack behaves as a single switch. The easiest way to tell is if the stacked switches support for example an LCAP trunk spread over multiple chassis. Another good indicator is if the switches has a dedicated special stacking module and cables, instead of using just normal Ethernet interfaces for the stacking.
A more meta question, what are you trying to gain from stacking these D-Links?