How to setup existing Magento 2 Project?
Follow below steps to setup existing magento 2 project.
Import the database by using this command. mysql -u [username] -p newdatabase < [database name].sql;
Clone or extract the source code of magento 2.
Run the composer update command, If composer is not installed then run first composer install & then composer update command. (If you get any memory limit error then run COMPOSER_MEMORY_LIMIT=-1 composer update command.)
php bin/magento setup:config:set --db-user="dbusername" --db-password="dbpassword" --db-name="dbname" or add any existing env.php file and update the host, dbname, username & password.
php bin/magento module:enable --all
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:di:compile
Table name : core_config_data
path : web/unsecure/base_url path : web/secure/base_url
Or you can change by using below commands.
php bin/magento setup:store-config:set --base-url="http://127.0.0.1/magento/"
php bin/magento setup:store-config:set --base-url="http://127.0.0.1/magento/"
php bin/magento cache:clean and php bin/magento cache:flush.