A couple of things I've found useful:

> How do I undo a change on the live site?

You use switch.  You switch the working copy to a previous revision.  If
you've got problems with people putting broken code in trunk, you may
want to consider a different strategy.  You could create a production
branch, check out the live site working copy from that branch, and then
merge all changes that you want to push live into that branch, or
(better) you could check out the trunk on to the test site, and then tag
releases once you've tested them on the test site, and then switch the
live site to those tested & tagged releases.

> how do I get a database dump from the live site?
> how do I get a database dump from the live site?
> how do I install a database dump from a live site onto the test site?
> how do I install a database dump from a live site onto a local site?
> where can a find a backup of the database in case I make a mistake?

I'm still working that out myself (I work with some systems that store
some configuration in the db ... yuck), but yes, you should definitely
store the db schema in SVN.  I find it is helpful to store some fixture
data in SVN to get you started with a test site.  If it's crucial to
have the development sites using the exact same data as live, you've got
some tricky stuff to do, but SVN might not be the right tool for this
particular replication problem.  

> how do I prevent certain files to be copied from local site to test
site?
> how do I prevent certain files to be copied from test site to live
site?

Well, you don't put those "certain files" in SVN.  Where files contain
information that is specific to the environment, you create sample files
and check THOSE in, which the person checking the code out can copy,
rename and modify.
For example, if you have an settings.php file that contains a whole
bunch of configuration information, you should first put settings.php as
an svn:ignore item, so that it doesn't ever get checked in (this
prevents some other developer's settings file from overwriting yours),
and you should create a settings.php.sample file which contains a sample
set of configuration settings which a developer can copy and rename to
settings.php and change to suit their own environment.

Good luck.

M.



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of nicolaas
Sent: Tuesday, 28 October 2008 10:43 p.m.
To: NZ PHP Users Group
Subject: [phpug] deployment....


Hi

I am a web developer who hosts on a variety of platforms.  I am using
SVN, but I dont feel I have a good system.  Deployment is driving me
nuts - what a pain - I NEED HELP.  Below are the notes I have made to
describe the setup and the questions I have.  I wanna work on my local
WAMP setup.  The CMS I am using has a Mysql database.  This, for
starters, makes it hard to replicate the site locally.  In the old
days, I used FTP to make changes directly on the live server.  While
this is dangerous, it is also really fast and straightforward.

Also to consider - I work with a bunch of other developers.  For them
it needs to be easy to hop on board and follow my systems.  For
example, I work with a front-end coder...

I have used SSH only once or twice.  From the few times I did, I found
it to be super slow.  I dont know how to use it - is this my problem?

*** concept

The SVN repository allows to:
- run a test site and a live site
- collaborate on the same files
- undo changes
- use WAMP/LAMP to develop fast on local machine


*** immediate problems

not all files should be copied to all places (i.e. htaccess, database
config files)
database should be the same when developing locally so that you can
see what it looks like without having to put in data.


*** setup

As we use a variety of hosts, the setup depends a little bit on each
host. However, in general - we use this setup:

*** SVN repository

has the following folders
>> branches - not used at present
>> trunk - latest version
>> tags - version 1, version 2, version 3
>> database - contains latest version of DB

*** databases

We need a test and a live database.

*** Server

test location (e.g. test.mysite.com) gets latest files from trunk (not
sure if this should be a cron job or on demand)
>> live location gets latest files from version X (on demand).
>> puts a database dump on SVN repository every hour or so - that that
you can download it with repo. and install locally

*** functions needed:

update test site from SVN trunk
update live site from SVN version
copy live database to test database
download database dump from test site


*** information required:

test svn location + username + password
live svn location + username + password
how to update things
phpMyAdmin address + credentials for live database
phpMyAdmin address + credentials test database


*** questions that need answering:

how can I work on the site?
- checkout from test site using SVN application
- get a database dump
- install DB dump locally
- work on site using local WAMP/LAMP setup
- commit changes (make sure to make a comment about what you have
done)

how to I make a change to the test site?
- change site (see above) - commit changes to test site

how to I make a change to the live site?
- make changes to test site,
- test
- commit from test SVN to live SVN

how do I prevent certain files to be copied from local site to test
site?

how do I prevent certain files to be copied from test site to live
site?

how do I undo a change on the live site?

how do I get a database dump from the live site?

how do I install a database dump from a live site onto the test site?

how do I install a database dump from a live site onto a local site?

where can a find a backup of the database in case I make a mistake?

etc.....


Please show me the light.  I want something fast and easy.

Thank you

Nicolaas





--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to