cancel
Showing results for 
Search instead for 
Did you mean: 

Clone magento 2.4.2 to a subdomain, for update

Clone magento 2.4.2 to a subdomain, for update

Hi all,

I am try to clone my production eshop (magento 2.4.2) to a subdomain to update it to newest version and then to re move to main domain.

1. on Plesk server, i created a subdomain (update.domain.gr)
2. copied all files from httpdocs to subdomain main folder
3. created a new database, new user 
4. On new db, i was change web/unsecure/base_url, web/secure/base_url, with new domain(update.domain.gr)
5. I edited app/etc/env.php with new database credentials

 

I was open eshop on update.domain.gr. Looks almost fine (with some 403 errors).

Now i want to run commands (php /bin/magento cache:clean php, php bin/magento cache:flush) but i want to run those commands on subdomain installation NOT on production domain.

 

So from Plesk subscriptions a selected magento subscription and from subdomain clicked on SSH Terminal. But on Plesk terminal i get this:
Last login: Thu Jul 25 09:33:11 2024 from 127.0.0.1
[domain.gr@hs23 ~]$

 

I'm afraid if I run the commands here they will be applied to production eshop. So I moved on subdomain directory (cd update.domain.gr) i run there the clear cache command:

[domain.gr@hs23 update.domain.gr]$ php /bin/magento cache:clean
Could not open input file: /bin/magento

 

Why i get "Could not open input file: /bin/magento"? Is this right to move to /update.domain.gr directory and run commands from there?

2 REPLIES 2

Re: Clone magento 2.4.2 to a subdomain, for update

So you moved all the generated Magento files from main domain to subdomain and didn't run any composer install or setup upgrade on the subdomian?

 

The way you approached this upgrade is kind of wrong, you should start from scratch, google some tutorials on how to properly upgrade Magento, how to set-up a staging environment that is a copy of production etc.

 

The way you intend to perform the upgrade is not the proper way.

 

 

Founder at https://agency418.com

Re: Clone magento 2.4.2 to a subdomain, for update

So, what's the preferable way?