I posted this over on M4C not long ago. You don't need to unpin your muzzle device to do what you want to do. Obviously, the instructions below are for going from RIS II to M-LOK, but I'm sure you can mop up what I'm spilling.
This question actually comes up quite a bit. If you have one DD Rail and want to swap for another, it's relatively easy to accomplish since all of our currently rail systems use the same barrel nut. The easiest swap is to go from a DDM4 Rail/AR15 Lite Rail III to a SLiM Rail and vice versa. These handguards are machined from the same extrusions and utilize the same bolt up plate. It's a simple 4 bolt swap assuming the handguard will clear your muzzle device. To go from a RIS II to an MFR Rail (M-LOK), it process looks like this -
1. Remove the Lower Rail of the RIS II by removing the 4 slotted screws located on the L & R side rails. Unbolt the 6 Bolts w/ a 5/32" allen wrench. A ball end will be handy for this. Once all bolts have been removed, you can take the rail system off. You might have to remove the Muzzle Device if it’s larger than the Inside Diameter of the Handguards. It's worth mentioning that the M203 hangers of the RIS II might not clear your muzzle device so it may need to come off. If your muzzle device is pinned and welded, you can get to the hanger screws with a ball end 1/8 allen wrench to remove the hangers. The Rail System would need to be completely unbolted from the Bolt Up Plate to accomplish this.
2. Loosen the Barrel Nut from the Upper Receiver using a DD Barrel Nut Wrench (included with all handguard purchases except Omega Rails). It’s not necessary to remove your gas tube but you might find it easier with it out of the way. With the barrel nut completely loosened from the upper, you can pull the barrel assembly out. The barrel nut will remain on the barrel assembly
3. Remove the RIS II Bolt Up Plate and Install the MFR Rail Bolt Up Plate
4. Reinstall Barrel Assembly and Torque Barrel Nut to 55 ft/lbs. Anti Seize is recommended.
5. Install MFR Rail and Bolt Up Adaptor, Align to Upper Receiver and tighten bolts in a criss cross pattern. 1/4-1/2 turn past hand tight is good to go. Actually torque value is 30 in/lbs.