cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone has the proper way to move magento 2 site?

Anyone has the proper way to move magento 2 site?

I search and follow the process to move site for magento 1.x but it seems that it is not working for magento 2.

I got this error when I access the new site.

 

"An error has happened during application run. See exception log for details. Could not write error message to log. Please use developer mode to see the message."

 

Anyone has the proper way to move magento 2 site?

 

Thank you!

3 REPLIES 3

Re: Anyone has the proper way to move magento 2 site?

Hello vbhb_bvnbv

 

Set Magento Permissions:


cd <your Magento install dir> 

find . -type f -exec chmod 664 {} \;

find . -type d -exec chmod 775 {} \;

find ./var -type d -exec chmod 777 {} \;

find ./pub/media -type d -exec chmod 777 {} \;

find ./pub/static -type d -exec chmod 777 {} \;

chmod 777 ./app/etc

chmod 644 ./app/etc/*.xml


chown -R owner:group . (including the last point dot, sets owner for all files under current Magento 2 installation) - Make sure you replace <owner>:<group> with your current user and the group that it's in. The most common ones are www-data:www-data, root:root, www-data:magento, etc however this can differ from server to server. 


chmod u+x bin/magento (add the execute permissions for bin/magento)

https://support.weltpixel.com/hc/en-us/articles/115001868933-How-to-set-Magento-2-permissions-and-av...

 

if issue solved and help ,Click Kudos & Accept as Solution

 



Re: Anyone has the proper way to move magento 2 site?

Hello @vbhb_bvnbv ,

 

 

I think you have to give me permission at once below way 

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./generated -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :<web server group> .
chmod u+x bin/magento

Before give above permission, Please deploy static content by below command 

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
chmod -Rf 777 pub/ var/ generated/
php bin/magento cache:clean

 

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Anyone has the proper way to move magento 2 site?

Hello @vbhb_bvnbv

 

First, change it to developer mode by going to your Magento root folder from command prompt and execute below command:

 

php bin/magento deploy:mode:set developer

 

Into the Magento directory, you'll find /var/log/exception.log. This is the file you should check to try to understand which kind of error you have.