cancel
Showing results for 
Search instead for 
Did you mean: 

copying a Magento 2.4 live site to dev on Plesk.

SOLVED

copying a Magento 2.4 live site to dev on Plesk.

I want to upgrade my Magento 2.4.2 site to the latest version but don't want to do it on a live site for obvious reasons but I am having trouble getting the copied site to look at the correct /pub folder as its trying to look at the original one.

 

On another 2.4 site & in the database under core_config_data there are 4 entries:

 

web/unsecure/base_static_url

web/unsecure/base_media_url

web/secure/base_static_url

web/secure/base_media_url

 

where I can change the entry to the new dev site & everything then works like the original site after but on another couple of sites theses entries don't exist.

 

Steps taken to copy site.

 

Create dev subdomain site on Plesk.

Copy all files from live site to dev site.

Create new database for dev site, dump live database & import into dev database.

change web/unsecure/base_url in core_config_data to dev site.

Update /app/etc/env.php with new database details

Delete /generated folder

Delete /pub/static folder

php bin/magento cache:clean

rm -rf var/cache/*

rm -rf var/page_cache/*

php bin/magento setup:upgrade

php bin/magento setup:di:compile

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

 

After all that the when I try to call the home page there are no images & no cms style sheets.

Any suggestions very very welcome.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: copying a Magento 2.4 live site to dev on Plesk.

Found the problem.

 

In deleting the /pub/static folder it deleted the .htaccess file.

Copied the .htaccess file from the live site now works as it should.

 

View solution in original post

1 REPLY 1

Re: copying a Magento 2.4 live site to dev on Plesk.

Found the problem.

 

In deleting the /pub/static folder it deleted the .htaccess file.

Copied the .htaccess file from the live site now works as it should.