Upgrade from Bitcoin QT 0.8.5 to latest Bitcoin Core 0.15.X
Go to Bitcoin 0.8.5 Console Window and run : 

dumpprivkey "myaddress"


Then in bitcoin 0.15.1

 importprivkey "mykey"


if you don't need to unlock your wallet even if it's encrypted since you are using Bitcoin-qt not RPC commands and you've already set your password when you started it.

if you don't want to use bitcoin-qt. go to terminal and run on v.8.5.0:

unlock your wallet if encrypted

(space)bitcoin-cli walletpassphrase "passphrase" timeout


Get private key of any address:

(space)bitcoin-cli dumpprivkey "myaddress"


if your wallet is encrypted run:

(space)bitcoin-cli walletpassphrase "passphrase" timeout


Then go to the latest version and run:

 (space)bitcoin-cli importprivkey "mykey"


The space before the commands is important to the command will never be saved to logs.