how to extract old code


I lost the code I have been running for the last 6 months on my UNO board. I would like to copy the code from the old board and upload it unto the new new one. Can this be done without the chance of losing the current code on the old board? I fear if I upload a new code and doesn't work, then I am left starting from scratch again and in the meantime have nothing up and running.

You can use avrdude commands to read/store the .hex file on a chip.
Hard to do much with the file (google C++ disassembler), certainly you cannot get back to your original .pde or .ino script.

Can get to user manual from here. Or maybe a software guru will help out.

avrdude -p -P -c -U flash:r::i

This will write out the memory contents to the file you name ().