If you remove the substrate to change good bacteria will be lost but, in most cases, most of the bacteria will reside in the filter media. Since I use under gravel filtration it would be different as my substrate IS my filter media. Since you want to go to sand I'm certain that you will not be using under gravel so you should be fine.
Actually if you got dry tanks without water and filtration the bacteria would be dead anyway for the most part. If this is the case I would suggest setting up the tanks as you want and then cycle.