0

Well, first good day to you, and i really beg you to excuse me if this is off-topic, but I just don't know what to do anymore.

Here is a little problem i face while I'm making transfer of live Magento2 website from one hosting to another.

As is shown in many posts here like this - How do I fix my Base URLs so I can access my Magento site?

And this also - How to migrate Magento 2.0.x from one server to another?

For me the process was from one hosting to another cause the boss here is not happy with the old hosting at all.

So, he bought new one, we set up the server with CentOS7 and WHM and cPanel so he can manages the things on his own when he want.

The boss didn't want to waist time to install new Magento 2 system on the servers, and my question is: Do I have to make a new installation of the Magento 2 or I can simple transfer of the website described below.

I did like this:

  • Exported the data base - PhpMyAdmin - export.

  • On the new hosting from cPanel i crated a new database with a specific name and then I did a successful import of the the database.

  • I've uploaded all the files of the website via FileZilla to the Public_HTML folder without no sub folders (like examp: - public_HTML/websitename/filesandfoldersofthewebsite) - just all the files of Magento 2, the theme, everything that was working on the old hosting

  • Edited the core_config_data to the new urls

  • edited the app/etc/env.php:

      array (
         'host' => 'localhost',
         'dbname' => 'nameofmynewdatabase',
         'username' => 'root',
         'password' => '',
         'active' => '1',
       ),
     ),
    

    ),

  • the new DNS is redirected to point to the new hosting and the new servers.

  • Also the new servers and hosting are requirements ++ to Magento2 system

  • Checked the composer, PHP version, MySQL, Cron, everything. Also edited the memory limits, said simple I did all the requirements.

it was really a mess while to run commands cause terminal return me a lot of mistakes like : php - no such a command, but at the end with some google I did :

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f

php bin/magento cache:flush

php bin/magento cache:clean 
   

and the terminal just executed the commands with no output.

The website is not loading in the browser - www.best-welding.com What I'm doing wrong or all this is just not possible ?

1 Answer 1

0

1st: If you have different domain name, then you need to update your domain name in database before upload on new server.

2nd: after transfer files on new server, Open this file app/etc/env.php and update database name, username and password according to new server also check if this downloadable_domains is using old.

3rd: Run below commands on root path:- also clear cache.

chmod -R 777 generated/
chmod -R 777 pub/static

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento index:reindex
php bin/magento cache:clean
php bin/magento cache:flush
2
  • Just a sec, I will try. Thank you for now :) Just one thing - the root path of the magento 2 website it has to be ?
    – Stef
    Commented Feb 15, 2021 at 10:38
  • where all website files are available like these folder are available app, bin, pub, var, vendor . that's root path. there you can run your commands. Commented Feb 15, 2021 at 11:05

Your Answer

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

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