WP was redirecting to install.php, I installed again and replaced old files with new one but lost all data

Always try to backup the database too.

In your case, probably the old database is replaced. See if you have a backup of database somewhere. Try to dig into wp_posts and wp_postmeta tables. Try to search old text from the old post and if you get results you are good, you can get them back, But if you don’t have one then I am really sorry to say, Nobody can help you brother.