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?

3 REPLIES 3

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?

Re: Clone magento 2.4.2 to a subdomain, for update

Hello @Astergios 

 

The error "Could not open input file: /bin/magento" means that PHP can't find the bin/magento file because you’re either not in the correct directory or you've referenced the wrong path.

 

Incorrect Path: The path /bin/magento suggests that you're trying to run the bin/magento script from the root of the system, not from your Magento installation directory.

 

It should be php bin/magento

 

​Hope it helps ! 

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

 

 

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9