Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Magento Environments

We have a Magento store setup and under version control, we'd like to setup a staging store which uses the same code but different connection details. e.g. Live details for the live store and a staging database for staging.

Is this possible with Magento, there doesn't seem to be a way to do it by default?

like image 291
Tom Avatar asked Feb 09 '11 17:02

Tom


2 Answers

There are many ways, one of the easiest that requires no additional extensions is

-> create

  • /app/etc/local.xml.dev
  • /app/etc/local.xml.live
  • /app/etc/local.xml.stage

and do NOT version control local.xml

and symlink the right file at each environment this way you can keep all connection info in svn or git,

like image 67
Istvano Avatar answered Oct 11 '22 08:10

Istvano


Tom,

Since you are using version control, I'd suggest you not have the same files for both staging and production. That's generally a bad idea. Ideally, you should have a different environment for staging and production, both having their own set of files, and their own database. This way, you don't have to worry about the hurdle you are experiencing now.

like image 24
Prattski Avatar answered Oct 11 '22 10:10

Prattski