A couple of weeks ago I spilled coffee over my MacBook. It was only a few drops but enough to break the keyboard. The rest of the internal parts were not affected. Some keys still worked but the back light on the right side broke along with most of the keys:

I had several options on how to proceed:
- Get it fixed by Apple or Gravis: My MacBook is pretty new. I just bought it a bit over half a year ago. My initial thought was to get Gravis to fix it in order not to void the warranty. Unfortunately, the people at Gravis and the Apple told me that fixing a broken keyboard of my MacBook model costs about 600€. The reason why this is so expensive is that Apple only sells the keyboard only as part of the unibody top case and that alone is about 400€. For the cumbersome procedure of changing the case Gravis would charge about 200€.
- Get a spare part and replace it myself: While this is a cheaper option it has more risks. It voids the warranty and there is a chance that I break it or something else unexpected happens.
- Ignore the damage and get a Bluetooth keyboard: This is the cheapest but not a good one. After all, I have the notebook to carry it around. I don’t want to bring a separate keyboard along with it all the time.
After evaluating those options I decided to go for a combination of option 2 and 3. I bought a bluetooth keyboard to keep my macbook functioning until I had found a used top case on ebay:

After figuring out what exact part to get I looked several weeks on eBay for a replacement top case. I ended up buying a used item for about 60€ with a working keyboard. I also bought the following tools (total about 25€) from iFixit:
- Phillips #00 screwdriver
- Tri-Wing Y0 screwdriver
- Torx T6 screwdriver
- Spudger (= a plastic tool with a flat and a tip end to remove connectors)
I found a great tutorial about replacing a top case at iFixIt. It is an amazing tutorial with high quality pictures and great instructions.
After two weeks I received the package with the tools and the new top case from the US. I was all set, the adventure could begin:

Step 1: Removing the bottom case
Easy so far 

Step 2: Removing the battery
The battery has to be removed using the the Tri-Wing screwdriver. It looks like Apple tries to make it difficult to replace the battery on your own by using this uncommon type of screws here. But once you have the right tools, removing the battery is actually quite simple.

Step 3: Removing the fans
The fans come off without any problems. I used the spudger here to disconnect the fan cables from the logic board.

Step 4: Removing the connectors and the logic board
This part is the most difficult one. The logic board has several connectors to all different kind internal parts. Since the logic board is the center of the computer everything is connected to it: Wifi, Bluetooth, iSight camera, keyboard+backlight, battery, display, trackpad, optical drive, power button, infrared etc. It is very important here that you do not apply force and make sure you apply force only the connector not the socket itself. Once all the connectors are disconnected, the logic board can be removed from the case.

Step 5: Remove the harddisk
Thats a very simple step, just a couple of screws and harddisk comes off.

Step 6: Removed Wifi, Bluetooth and iSight camera
I then carefully disconnected the antennas (they are all in the display) and removed the cable channels. This is beautifully done by Apple. I admire its compact design.

Step 7: Remove optical drive
Since the optical drive is already disconnected it is easy to remove the optical drive.

Step 8: Separate display from the case
After removing the cable holders and removing the screws that hold the display I separated the display from the case.

The display by itself looks a bit like a big iPad 

Done!
That’s it. All parts are removed from the top case.

All internals of the MacBook in one picture:

Behind the black protection of the keyboard the coffee is visible. Guess it was a bit more than a few drops…

I then repeated all steps in reverse order with the new top case. The logic board was a bit tricky to put back on because you have to attach the power connector under the board. It was easier for me to remove the power connector from the top case, connect to the board, and reattach the power connector while holding the board with the other hand.
After putting it all back together, I turn on the MacBook and…
… it works. I succeeded! The MacBook and all its sensors work fine without any problem. The best of all: the keyboard works
My lessons learned:
- Don’t ever, ever, ever spill coffee over your laptop!
- When you choose to repair on your own, make sure you are well prepared, have to right tools and you know what you are doing.
- Try to find something to put the screws in while you replace the top case. Make sure you have a system that helps you remember what screws are for what step of the procedure. This is important, you have to work with over 40 screws of at least 10 different types.