Multiple Magento Environments

We have a Magento store setup and under version control, we would like to set up intermediate storage, which uses the same code, but different connection information. e.g. Live data for a live store and an intermediate database for placement.

Is this possible with Magento, apparently there is no way to do this by default?

+5
source share
9 answers

Tom,

, . . , , . , , .

+6

, , :

- >

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

local.xml

, svn git,

+12

. , , ...

/app/etc/local.xml

, . local.xml:  - /etc/production.local.xml  - /etc/staging.local.xml  - /etc/my -dev.local.xml

local.xml, , . softlink local.xml :

cd app/etc
ln -s production.local.xml local.xml

:

/sql , , :

  • createdb.sql
  • production.setup.sql
  • staging.setup.sql
  • -dev.setup.sql

createdb.sql MySQL .

create schema magentoschema; create user magentouser;
grant all on magentoschema.* to 'magentouser'@'localhost';
set password for 'magentouser'@'localhost' = password('secret');

mysqldump :

mysqldump -u magentouser -p -h your.host.name magentoschema > magento.dump.sql

, :

mysql -u magentouser -p -h localhost magentoschema < magento.dump.sql

(, , ) core_config_data. :

update core_config_data set value='http://staging.yourstore.com/' where config_id in (3,4);

Magento, , config_id web/secure/base_url web/unsecure/base_url . , jsut , :

select * from core_config_data where value like 'http%';

, *.setup.sql script mysql , , :

mysql -u magentouser -p -h localhost magentoschema < staging.setup.sql

!

+4
+1

.

local.xml etc db.

url core_config_data.

0

, .

PHP IF, XML . local.xml .htaccess.

, .

0

Magento.

, :

1) , SQL. 2) , yourwebsite.com stage.yourwebsite.com. 3) MySQL.

4) . 5) /etc/local.xml - /. 6) var/cache/ var/session (, ).

.: -)

0

http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server

wamp zend.

- , ( , )

:

baseurl securebaseurl , "localhost" , ( , zend- wamp/lamp, , , )

0

All Articles