Question

I'm currently working a Magento 2 (2.1.14 exactly) mutli-store website and I have some problems for create a development website. I'm the only back-end developer in the company and had never work on Magento 2 before so I'm learning little by little how does it works.

We need to upgrade the Magento version, some plugins and add some functionnalities but I really need to have a clean development setup to work in, without the fear to break the production website.


Problem ⚠️

Current mode : developer

I followed these steps below but the dev website (dev.mywebsite.ch) still redirect me on the production server (www.mywebsite.ch).

  1. Create folder on server dev.website.ch
  2. Create a sub-domain and point to the newly created folder
  3. Copy all files and folders in it with rsync -avz source/* dest/
  4. Create a database dump filedump.sql
  5. Clean the dump file (advice from MgtCommerce) like sed "s/\/\*[^\/]*DEFINER.*\*\///" dump.sql > clean_dump.sql
  6. Import the dump file in the suitable DB
  7. Change the database detail in app/etc/env.php
  8. Change base URL and base secure URL in core_config_data table in the dev database

I also executed all commands I use when I want to upload a new thing/bug fix (SSH) :

  • chmod 775 /home/cloudpanel/htdocs/*/ -R
  • php bin/magento setup:di:compile
  • php bin/magento setup:static-content:deploy en_US fr_FR de_DE
  • php bin/magento cache:flush
  • php bin/magento cache:clean

Questions I used...

Was it helpful?

Solution

Cache

Try running the below commands

rm -rf var/cache var/view_preprocessed var/page_cache generated/* pub/static/frontend
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

This should solve your problem


SSL

If SSL isn't enabled on your development domain, make sure to use http:// in all core_config_data table entries (and not https://)

OTHER TIPS

the redirect problem was due to magento cache.

try to deleted everything from var/ folder for your magento site(dev.website.ch). after that you cleared your browser's cache/cookies or try with private browser for good measure & it worked!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top