I need to move the main panel to allow for new cabinets.It will be moved to other side of exsiting wall. I'm sure there are going to be short wires. What is the best way to extend wires to reach breakers?
For the branch circuits, if the wires/cables can still properly enter the panel enclosure you can simple extend the wires with wirenuts. This IS legal and proper contrary to what some might say.
If the cables do not even reach the panel box then you should splice them in junction boxes with the same size and configuration of cable to reach the panel.
Yes, you'll have short wires. I just dealt with a whole factory where someone went around the edge of every service panel and cut all the wires. There are several ways to deal with this.
install junction boxes in places the short wires can reach, then splice short runs from there to the panel. This is not a problem but you'll want to wire-nut firmly. You have to watch out for box stuffing limits - you need 2.25 cubic inches per splice. The junction boxes must be accessible without removing parts of the building.
they make special splice kits designed to splice Romex in-line without use of a junction box, to be buried behind drywall. These are rare, because they have to be rated for this type of service. Tyco is pretty much the "go-to" for those.
If you have the room, you could put a "sub-panel" that is within reach of the wires that can't reach the new main panel.
On feeders you don't want to splice and not allowed in my state for grounding electrodes in all but a few cases . Since it would be safest to pull the meter and put in a new longer conductors from the service to the new panel location this might require a new "green tag" in my state to replace the meter. Once the inspector verified the wire size and connections/ permits will sign off if all is correct by the home owner but not in all states some require a master or supervising electrician to make these connections. To add to this answer since 1 comment said only splicing the breaker / branch circuit wires. This can be accomplished by installing a metal "gutter" at the location of the current box. It requires clamps for the wires entering and exiting just like the panel. Then wire nuts to make the connection with the new extensions to the panel. Gutters can be mounted in walls or surface mounted. The one thing to verify is the total number of wires entering and exiting the "box" and calculate the needed size in square inches so you don't exceed the box fill requirements.