Upgrading from version to version

Please how can one upgrade from OJS version to OJS version without messing up the database? I believe that if I install the new version it will override the existing version and mess up my database. Can someone help please.

please export current version of database and keep it as backup.,Also, please make copies of your data folder with pdfs and usually public folder in which OJS puts images and copy of config.inc.php file.
After that you can do upgrade and if necessary you can try again with backup copies as I mentioned above.