I was installing Magento 2 in name magento folder but some reason it was unsuccessful. So again I tried installing it in magento1 folder but while setup, I forgot to change the old store address that is http://localhost:8080/magento. Now magento installed successfully but with old address and there is no files in that magento folder. Then i copied all magento files from magento1 folder to magento folder. But problem not solved. Is there any solution for it or I have to again do the fresh magento installation?
This is a common problem and you can find many people, answered regarding this question.
To solve this issue, open your database, look in to the database table called 'core_config_data'.
In this table, find the rows with path
web/secure/base_url . You could find the value of these paths points to your old magento root folder. Update this path to your new magento root folder and it will solve this issue.
You can also do this from the magento admin. Go to Store => Configuration => General , open the tab called Web and there you can see the Base URL and Secure Base URL sections. Update the value to your correct folder path. Clear cache , Logout and Log in again. That's it.