dinapolis the only file that needs to be different between the 2 copies of the site is config.php
, to point to the separate staging database.
vendor
only contains extensions and dependencies, no data. That's why it can either be copied or re-created, it doesn't matter, it's just code downloaded from Packagist in there.
What I meant is that if you already have staging with its own database, you can just update the database with a different dump and it will be reflected on the stating website.
Something to be careful of, if you copy the production database, make sure emails are disabled on the staging server. The database does contain the email driver setting and credentials, so you should set the mail_driver
value in the settings
table to null
or log
unless you want to do tests specifically with your email server. You might also want to clear the database jobs queue (if you use it) to not run any pending jobs from production on the staging server.