In combination with a MagSafe-to-MagSafe2 converter the power adapter from my 2007 MacBook is still useful. I keep it at home so that I can use my newer power adapter at work and leave it there. After 7 years of constant use unfortunately the cable that is connected to the MacBook broke very closely to the outlet.
The first website to take a look at is of course iFixit. The guide explains very well how to open the casing and how to solder the shortened cable to the adapter. The trick how to open the casing is from an Instructable. I found it easier to use the pliers instead of heating the casing with a hair dryer. To prevent things from flying around I kept the adapter in position with my knees while I pushed the casing with the pliers apart.
Inevitably the plastic of the casing will break at certain points but it should break very evenly that it can be glued together afterwards.
The next step is to prepare the cable relief. It is glued to the cable so it is necessary to remove most of the plastic and to make sure that the shortened cable fits into the hole.
I removed about 6-7cm just to make sure the damaged part of the cable is gone.
Now the stripped cables can be soldered together and isolated with heat shrink tubing. I also added a zip tie as cable relief.
With the old cable relief back in place we are ready to glue the casing together.
Just make sure the cord winding ears are in position before you start. I used a glue which was explicitly suitable for the ABS thermoplastic of the casing.
DIY is great! It was a lot of fun and also saved 79€ for a new power adapter.