1

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
  • You want to push your complete code to ur domain.com instead of domain.com/new folder right
    – Ajithkumar
    Dec 12, 2018 at 12:50
  • yes. without affecting the code Dec 12, 2018 at 12:52

2 Answers 2

2

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

enter image description here

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 enter image description here

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
1
  • 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?
    – juanbits
    Aug 17, 2020 at 17:39
1

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
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.