I don't know if there is a better way, what I would do is set up a temporary tank and net all shrimps (easier said than done, I know) to the temp tank, then do whatever to the substrate, wait for a few days and slowly move shrimps back (if the moved ones don't do well then stop until they do well before moving more back).
Change substrate while shrimps are there can do harm to the shrimps. You could also do it slowly like 1 liter of substrate out, 1 liter of new in every day but I think that's more work and still risky.
Change substrate while shrimps are there can do harm to the shrimps. You could also do it slowly like 1 liter of substrate out, 1 liter of new in every day but I think that's more work and still risky.