Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I make a copy of production to a test on the same server
 
dahechler
Member
 
Total Posts:  47
Joined:  2008-12-18
 

I want to copy my production environment to a test environment on the same server.

Assuming the production is called “magento” and I want the test to be “magtest”

What are the steps ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

its pretty easy.

i run a production and dev setup on the same server..

1. setup a new website using cpanel/plesk/ whatever you normall do
2. setup a new mysql db for the development site
then from ssh do the following.

3. remove cache from production wesbite

rm -rf var/cache/* var/session/* var/report/*//tempend ?>

4. tar up the whole production website

tar -zcf website-backup.tar.gz *

5. dump the db

mysqldump yourdatabase_magento --single-transaction yourdatabase_magento.sql

6. move the tar file to the development site and untar into root.

tar -zxvf website-backup.tar.gz

7. load the database backup into the development db

mysql yourdatabase_magento yourdatabase_magento.sql

8. change the app/etc/local.xml to reflect the database name and username & password

also you may have to chown the files & folders to reflect the new website

9. re-run pear setup also

./pear mage-setup .

10. Edit the core_config_data table. Look for the product website url in the path field “web/unsecure/base_url” and change to the development website url.

hth
brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
dahechler
Member
 
Total Posts:  47
Joined:  2008-12-18
 

If I don’t have an SSH access, how do I run

./pear mage-setup .

Thanks, Duaine

 
Magento Community Magento Community
Magento Community
Magento Community
 
aloeroot
Jr. Member
 
Total Posts:  18
Joined:  2008-07-24
 

Thanks for this - it was very helpful.

With regard to step 10 - it’s very important to include the trailing slash at the end of the url, otherwise you’ll have some path issues.

If you don’t have SSH access to the server yourself, contact your hosting company and ask them to run the command for you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

Well, I think the pear-command is not absolute necessary.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aloeroot
Jr. Member
 
Total Posts:  18
Joined:  2008-07-24
 

Discovered today - I used this method to make a test copy of my live store. Then, I tried to use Magento Connect Manager to upgrade the TEST store, using the backend of the TEST store, but it upgraded the LIVE store. Apparently you also need to reconfigure the test copy of Connect Manager somehow so that it performs the upgrades in the right spot.

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

aloeroot is correct. Just found this thread and if you do not update the pear.ini file it will update your live site. you have to change the magento/downloader/pearlib/pear.ini file

See this thread for more about the pear.ini file

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top