I'm assuming that you're referring to a M4 type rifle? If so, it's quite simple but does involve getting right into the mechbox to reroute the wires.
Because of the way that it's routed differently between front and rear (the wires take a different path through the mechbox) you battery wires will end up different lengths and depending on what kind of rear stock setup you're going for (i.e. full stock vs. collapsible stock) the wire lengths may not work.
If you can solder wire, it's far easier and cleaner to just remove the existing wire and replace it with new wire.
The actual switch assembly is the same.
If you're referring to an MP5 it's usually very easy, with no internal mechbox work. Same with AK's.
Best of luck,