Apple's iTunes software is, in the main, designed to transfer data to their devices but not in the other direction. In general if you try to connect and sync an Apple device to a new library iTunes will want to erase all the current media content and replace it with items from the new library.
Should you be in the unfortunate position where your computer has been lost, stolen or damaged and you have no viable backup of your library then you can use the steps below to attempt to recover most, if not all, of your media and other information from your devices. If, however the library that has been lost or damaged was on your current computer see Empty/corrupt iTunes library after upgrade/crash first.