cancel
Showing results for 
Search instead for 
Did you mean: 

How to move Magento 2 to a new site?

How to move Magento 2 to a new 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!

 

9 REPLIES 9

Re: How to move Magento 2 to a new site?

Which process are you following to move the site?

 

And also; can you set development mode on your M2 installation so you can see the error?

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: How to move Magento 2 to a new site?

I mainly follow this link,

https://www.siteground.com/tutorials/magento/magento_move.htm

 

The tar command line is incorrect but I figure it out.

Re: How to move Magento 2 to a new site?

Just for a side note,

 

I am trying to install magento 2 with sample data on my local Centos 7 on ESXi vm but It failed at sample data install.

So I tried to install magento 2 with sample data on one of my dedicated server with Centos 7 and it works.

I have no idea why my local vm won't work so I am thinking to copy my magento 2 from dedicated server to my local vm.

 

Re: How to move Magento 2 to a new site?

Here is what I get when I turn developer mode on.

 

exception 'Zend_Cache_Exception' with message 'cache_dir "/var/www/html/magento2/var/page_cache" is not writable' in /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php:209 Stack trace: #0 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...') #1 /var/www/html/magento2/lib/internal/Cm/Cache/Backend/File.php(82): Zend_Cache_Backend_File->setCacheDir('/var/www/html/m...') #2 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array) #3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true) #4 /var/www/html/magento2/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php(153): Zend_Cache::factory('Magento\\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true) #5 /var/www/html/magento2/lib/internal/Magento/Framework/App/Cache/Frontend/Pool.php(67): Magento\Framework\App\Cache\Frontend\Factory->create(Array) #6 /var/www/html/magento2/lib/internal/Magento/Framework/App/Cache/Frontend/Pool.php(146): Magento\Framework\App\Cache\Frontend\Pool->_initialize() #7 /var/www/html/magento2/lib/internal/Magento/Framework/App/Cache/Type/FrontendPool.php(84): Magento\Framework\App\Cache\Frontend\Pool->get('default') #8 /var/www/html/magento2/lib/internal/Magento/Framework/App/Cache/Type/Config.php(49): Magento\Framework\App\Cache\Type\FrontendPool->get('config') #9 /var/www/html/magento2/lib/internal/Magento/Framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\App\Cache\Type\Config->_getFrontend() #10 /var/www/html/magento2/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader.php(66): Magento\Framework\Cache\Frontend\Decorator\Bare->load('global:Smiley Very HappyiConfi...') #11 /var/www/html/magento2/lib/internal/Magento/Framework/App/ObjectManager/Environment/Developer.php(76): Magento\Framework\App\ObjectManager\ConfigLoader->load('global') #12 /var/www/html/magento2/lib/internal/Magento/Framework/App/ObjectManagerFactory.php(181): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Array) #13 /var/www/html/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(384): Magento\Framework\App\ObjectManagerFactory->create(Array) #14 /var/www/html/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(231): Magento\Framework\App\Bootstrap->initObjectManager() #15 /var/www/html/magento2/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #16 {main}

Re: How to move Magento 2 to a new site?

Hi,

Is the cache dir writable?? What permissions are set on it ?

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: How to move Magento 2 to a new site?

it should be. Here is the cache dir.

 

drwx------. 2 apache apache 6 Aug 13 04:56 cache
drwx------. 3 apache apache 34 Aug 12 18:48 composer_home
drwx------. 3 apache apache 20 Aug 12 19:29 generation
drwx------. 2 apache apache 57 Aug 12 18:59 log
drwx------. 2 apache apache 6 Aug 13 13:44 page_cache
-rw-------. 1 apache apache 8 Aug 12 20:38 sample-data-state.flag
drwx------. 2 apache apache 6 Aug 13 04:56 session
drwx------. 4 apache apache 30 Aug 12 19:00 view_preprocessed

Re: How to move Magento 2 to a new site?

ok, I found the problem.

 

My dedicated server has SELinux disabled but not on my local vm.

After I disable SELinux on my local vm, it is working fine now.

 

BTW, Do we need SELinux for Magento?

Re: How to move Magento 2 to a new site?

SELinux isn't a bad thing, it really locks down some insecurities with the filesystem. 

Re: How to move Magento 2 to a new site?

What an interesting comment!

 

"SELinux isn't a bad thing" why, because "it locks down insecurities with the filesystem".