can’t really share much, but here’s what I can do (running Linux, simple sh script without fancy stuff):
# arg1: local path to sync from (root of magento tree)
# arg2: hostname of shop server to sync to
# This script is supposed to sync a testing environment to a shop webserver.
# 1. rsyncs all necessary files (and omits ballast)
# 2. sets correct permissions
# 3. clears cache (and sessions)
# 4. does not touch local.xml
--archive --compress \
--exclude=/media/ --exclude=/var/ \
ssh $USER@$2 chown -R www-data.shop $REMOTEPATH
ssh $USER@$2 rm -rf $REMOTEPATH/var/*
This is very experimental. Things will NOT work until you have set up your local.xml and database. I standard-installed magento on my live system, saved my local.xml, then deleted everything, used the script to install to my changed code, replaced the local.xml and I was up. Database updates (if any) will happen automatically as soon as the first page is called up.
Additional excludes (consider carefully):
- if you don’t use Magento Connect on your live system: --exclude=/downloader/
- if your live system doesn’t need the admin interface: --exclude=/app/design/adminhtml/ (and even more code under app/code/core)
- Syncs more than is necessary
- Kills active sessions (not nice)
- May also overwrite files whose importance eludes me up to now (app/etc/config.xml?)
- Needs to fix permissions on some files, e.g. local.xml may have been created with 644 permissions depending on your umask, which may be a security risk if you have other users on your machine (local.xml contains the encryption key used for customer data)
- What about the ‘report’ folder?
If you’re just getting started, you may want to wait a bit until you invite complications by using the above. Anyway, I’d by happy to help.