It depends on what model you move the hard disk into, and what OS it’s running.
If it’s an identical model, or one that can run the OS that’s currently installed, then you’ll be able to just switch the HDs around.
If you upgrade it to a newer model, you’ll still be able to switch the hard...