Subversion - Am I barking up the wrong tree?
Permalink
Hey folks,
I broke my site yesterday morning, so I'm trying to get version control rolling. when i commit changes from my local machine and then update the live site (and swap the local database into the live site), things like the pictures get wiped out.
Any ideas what I'm doing wrong? Or is subversion a royal pita with C5?
thanks!!
john
I broke my site yesterday morning, so I'm trying to get version control rolling. when i commit changes from my local machine and then update the live site (and swap the local database into the live site), things like the pictures get wiped out.
Any ideas what I'm doing wrong? Or is subversion a royal pita with C5?
thanks!!
john

subversion should work fine, so should git, (I actually know both work)
Subversion is a royal pita, but once you get familiar with its ins and outs it's totally workable -- but the trick is it's only good for the code of your site, not the content.
Here's how I use SVN with C5 development:
* When I first create a new C5 site, I temporarily move the "files" directory outside of the site directory, then I commit the base C5 site to my repo (without the "files" directory in there).
* Then I set the "svn:ignore" property on the site directory to exclude the "files" directory, then commit that (you're just committing the new property on that site directory).
* Now you can move the "files" directory back into the site directory. Whenever you commit/update/whatever, the files directory is ignored.
OKAY, so you have successfully separated your code from your content. Now you need to back up the content as a separate step. I usually back up the database via the C5 Dashboard, which saves a backup SQL file into files/backups, then I ZIP the entire "files" directory (which now contains the latest SQL backup), and then manage that ZIP file separately from the SVN repo.
Perhaps there's a better way to do this, but this works well for me (one day I'd like to automate the database backup and zipping of the files directory so it's one step, but for now it's working good enough).
Here's how I use SVN with C5 development:
* When I first create a new C5 site, I temporarily move the "files" directory outside of the site directory, then I commit the base C5 site to my repo (without the "files" directory in there).
* Then I set the "svn:ignore" property on the site directory to exclude the "files" directory, then commit that (you're just committing the new property on that site directory).
* Now you can move the "files" directory back into the site directory. Whenever you commit/update/whatever, the files directory is ignored.
OKAY, so you have successfully separated your code from your content. Now you need to back up the content as a separate step. I usually back up the database via the C5 Dashboard, which saves a backup SQL file into files/backups, then I ZIP the entire "files" directory (which now contains the latest SQL backup), and then manage that ZIP file separately from the SVN repo.
Perhaps there's a better way to do this, but this works well for me (one day I'd like to automate the database backup and zipping of the files directory so it's one step, but for now it's working good enough).
Well, after wrestling immensely with this, it seems i've got subversion working - for now, anyways!!
@jordan - what i did was import a fresh C5 stack into my repo, and checked it out to both my live site and my local machine, and did the installations. As i made changes to the local working copy, I went to Versions to see what changed, and found that the most pertinent thing that changed was the numbered folders within the "files" directory (like when I added photos). I'd add and commit those changes, svn up the live site, ftp over the database from my local machine to the files/backups folder, and then restore that database within the live site.
Seems to work so far. The learning curve has been awfully steep (command line is very new to me), and I don't presuppose this is the simplest way, but it seems the simplest way I can have 2 local machines (desktop and laptop) have immediate access to the current version.
Thanks for the reply!!
@jordan - what i did was import a fresh C5 stack into my repo, and checked it out to both my live site and my local machine, and did the installations. As i made changes to the local working copy, I went to Versions to see what changed, and found that the most pertinent thing that changed was the numbered folders within the "files" directory (like when I added photos). I'd add and commit those changes, svn up the live site, ftp over the database from my local machine to the files/backups folder, and then restore that database within the live site.
Seems to work so far. The learning curve has been awfully steep (command line is very new to me), and I don't presuppose this is the simplest way, but it seems the simplest way I can have 2 local machines (desktop and laptop) have immediate access to the current version.
Thanks for the reply!!
Yeah, it's not a simple problem to solve. Sounds like what you have works for you so keep with it. Just a word of warning: as the site grows and more and more content is added to it, your files directory will become HUGE and probably will not be efficient to keep storing it in your SVN repo. But that doesn't usually happen when building a site -- only after you've deployed it and "real" content gets added by you or the client or whoever.
cool bro, thanks for the tips!!