Test Environment Site

Hi, I want to have a test version of my site. The codebase will be the same but I need different environment variables to point to a different datasource, etc. It’s not really a branch or a deployment stage, just a separate site with the same codebase that points to test data.

What is the best/correct way to accomplish this?

Thanks in advance!

Dave

Hi @fontzter

You could set a new site, linked to the same repository, and configure environment variables via the Netlify UI for the test datasources, etc. If you are on Pro plan or higher, you could password the site if not wishing others to have access.

Thank you. That makes sense. I just wanted to know best practices and wasn’t sure if there was some way to clone a site. Thanks again

Is it possible to do something similar but levering the deploy preview feature of Netlify?
I would like the “test” environment to be the deploy-preview builds.

Deploy previews are created for pull requests, which I believe is not possible without branches. But if you open a pull request to your production branch, a deploy preview will be built (based on your site’s settings) and you can then test it.