Hi I have installed the developed the magento 2 in the path domain.com/new folder and developed in that path. Now I want push the installed file to the public_html file without affecting the code.
2 Answers
Using Files
Navigate to app/etc and rename di.xml and config.php file.
Now you are hit your domain url it will redirect to installation page and then enter all credential and current database name
Using Database
Step 1 : Copy and paste all your magento file in your public_html path
Step 2 : Go to database and find "core_config_data" table
Step 3 : Replace your domain url in "web/unsecure/base_url" and "web/secure/base_url" or admin panel have option change secure&unsecure base url
Step 4 : Run below command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
-
i moved my magento from /path/oldfolder to /path/newfolder, i maintain my domain, just changue the domain read the new folder instead the old folder. I did it using the "Using Database" method that you mention, but when i try to acces to the admin, i got "too many redirections" error. any idea?– juanbitsAug 17, 2020 at 17:39
You need to copy all content/files(new folder in case of you) to public_html folder. You just need to change/set the Base url and base url secure
- From backend store->configurations->web Base URLs (http://domain.com)
- open up database table core_config_data and find under path web/unsecure/base_url change its value to your domain name (domain.com) and path web/secure/base_url value to (https://domain.com)
- clean cache