updating the Arduino IDE

I think I want to update my Arduino IDE from 1.6.11 to 1.8.5. How is the bet way to do this so that I do not lose any of my sketches and libraries that I have already setup? s there a guide somewhere?

As long as you have not installed anything to the Arduino IDE installation folder nothing will be lost. The sketches and libraries in your sketchbook folder will not be affected by the update. This is why it's always advised not to ever install anything to the Arduino IDE installation folder.

If you have installed anything to the Arduino IDE installation folder then you will want to remove it before you update.

I just downloaded and unzipped 1.8.5. Just for fun, I started the .exe and it seemed to compile and run my last sketch. My sketch included a library that is not in the 1.8.5 folder. How did 1.8.5 know where to get the library? I am a bit confused as to how my directories shouyld be organized so that as new updates are available I can do so easily.

Assuming I have a clean install directory, where should Iput my new sketches and libraries? Are they a sub-directory of he install or in a separate directory wioth a special name?

Your preferences are saved to a file outside the Arduino IDE installation folder so they will be shared between any installations. One of the preferences is the sketchbook folder location. There is a subfolder of the sketchbook folder named libraries where libraries are typically installed. So any installation of the Arduino IDE will automatically be able to find libraries from that location without you needing to do any configuration..

barryjo:
Assuming I have a clean install directory, where should Iput my new sketches and libraries?

It's not a good idea to put sketches in the Arduino IDE installation folder but other than that they can be put anywhere you like. Sketches placed inside the sketchbook folder will be accessible via File > Sketchbook so it's convenient to store them there but not required. You can open sketches from any location via File > Open or double clicking the sketch file if you have .ino files associated with the Arduino IDE. You can find/set the location of your sketchbook folder at File > Preferences > Sketchbook location.

Libraries should be put in the libraries subfolder of the sketchbook folder. There are a few other locations where libraries are installed, including some in the Arduino IDE installation folder but it's not a good idea to install anything to those folders unless you have a good reason for doing so.

Thanks for the info. I will do as you suggest.

A final question. I assume that I can have a folder called "ArduionoShetches" that only contains the Library subfolder. Then I can have sketches anywhere else in other folders or drives and this is OK because the IDE compiler will look at the Arduinosketches folder for the library. This way, I can have a folder for each project along with other project documentation and this way the random junk in my project folder will not contaminate the ArduinoSketches folder or the Library subfolder.

This seems to be the case I just want to make sure.

That's fine, except the library subfolder is named "libraries", not "Library". The Arduino IDE will automatically create that folder for you when you set the sketchbook folder.