The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

subversion repository - where should it reside?

I know this might be a dumb question. But, what the hell.
I just started using subversion for web development(working solo, no one else needs access currently). Should my repository reside on my development machine or production?

I currently have the repository on my local develpment machine, so if the answer is "it belongs on live server" could I simply copy my repository to the server? or would I need to create and re-import all my files?

Thanks for any suggestions.
Sam Send private email
Wednesday, July 26, 2006
 
 
The repository should be on a separate machine that's backed up. Your dev and production machines will typically have a working copy, not the entire repository.

The safest way to transfer a repository from one machine to another is to use the svn_admin dump command to make a dump of the source repository, and then svn_admin load to read the dump into the new location.
Chris Tavares Send private email
Wednesday, July 26, 2006
 
 
Chris, thanks for your response.
Sorry if I'm being dense here, but if I'm doing development on my local machine and uploading to a production server where does a "separate machine that's backed up" reside?
or maybe I'm just misunderstanding and you mean the repos should not reside on the development machine?
Sam Send private email
Wednesday, July 26, 2006
 
 
The "repository" is not something that you ever manually touch yourself. Think of it as the SVN database. You can ask SVN to add new files to the repository or to commit changes to the repository. You can checkout any files that are in the repository.

But you never actually touch the repository itself. Only SVN touches the repository.

Having said all that, here's my (solo) setup:

* My repository lives in a directory called "Z:\repository" on an external hard drive, connected to my development machine.

* I check out a local working copy, to "D:\workspace", also on my development machine.

* When I'm ready to deploy to my production machine, I do a clean checkout, into a new directory and then I upload the new directory to my web server.

Ideally, I'd prefer to do another checkout directly from my production machine. But my production machine is remote, and my development machine is behind a router, so it'd be a pain to enable direct access from the prod machine to the dev machine.

Maybe one of these days, I'll deploy directly from SVN to production, without the manual upload. For now, though, it works well.
BenjiSmith Send private email
Wednesday, July 26, 2006
 
 
My setup is like this: 

I have a Debian box running subversion in a closet.  This I back up on a regular basis.

On my development machines, I use TortoiseSVN and AnkhSVN (the latter when using visual studio) as well as the command line tools, to bring down the working copy, code, etc,.

I don't recommend running the server on the same machine as you develop on.  Computers are really cheap, and you don't need a great machine to run Linux and Subversion.

My backup strategy has been to tar up the whole repo directory and burn to CD.  I normally try restoring this right after backup to verify things went well.

However, someone mentioned svnadmin dump-- is this a better way to backup? Or should I just RTFM ;)
Meganonymous Rex Send private email
Wednesday, July 26, 2006
 
 
I got the suggestion to use svn_admin dump from "Pragmatic Version Control using Subversion". It's the recommended way to do backups of a repository. If you just back up the directory, you'll get things like temp files and lock files which could really screw you up. With dump, you just get the repository at a known state.

Also, with dump / load you can move versions of SVN or switch easily between FSFS and BDFS repositorys. And dump can do an incremental backup, which tar will never do.
Chris Tavares Send private email
Wednesday, July 26, 2006
 
 
svnadmin dump lockes the database. If you have many people owrking day and night, you can use svnadmin hotcopy to backup the whole database.

We use cron to execute a backup script at weekend. The script calls hotcopy to backup the database, as well as other databases we are using, and pack them into an ISO image. It sends an email after completing the task. On Moday monrning I just put a DVD into the burner and burned it.

An advice - if you are working solo, get a separate machine for repository. You won't regret it.
Burner
Wednesday, July 26, 2006
 
 
I run it on my development machines at work and at home. I have a script that makes a backup of the entire repository on every commit, and I make backups of those backups regularly. Works for me.
sloop
Thursday, July 27, 2006
 
 
If you arent too hot at linux administration but dont want to shell out for a windows license either then have a look at this...

http://buildix.thoughtworks.com/

Its basically svn, trac and cruisecontrol all rolled into an debian iso, no messing around setting up stuff, it all just works out of the box.
Foxedup
Thursday, July 27, 2006
 
 
I'm a solo developer; I don't have any spare machines, that's why I use Dreamhost to host my svn repository.
Shey Send private email
Thursday, July 27, 2006
 
 
I have my development machine and repository backed up nightly, is that acceptable?
I mean what's difference if I have the repository on a spare machine as opposed to my development machine?
Sam Send private email
Thursday, July 27, 2006
 
 
I'm in similar boat as Shey... I host an svn instance at textdrive.com for around $5-10 a month.  Its fully backed up and accessible from anywhere and you also get a nice unix environment to boot. (no affiliation)
melon_helmet
Thursday, July 27, 2006
 
 
Foxedup: That buildix thing looks great.  I'm going to try it out on one of my spare pull-out drives.

Thanks for the tips on backup everyone, I guess I SHOULD have RTFMd.
Meganonymous Rex Send private email
Thursday, July 27, 2006
 
 
"I have my development machine and repository backed up nightly, is that acceptable?"

Of course it is.

"I mean what's difference if I have the repository on a spare machine as opposed to my development machine?"

There's no difference. There is absolutely no need to have the repository on a separate machine. Just keep making backups and you're fine.
sloop
Thursday, July 27, 2006
 
 
What slope says.

You can keep your SVN repository whereever you want it. As long you back it up. Putting it on another computer is silly if you are the only one using it. If you use TortoiseSVN you do not even have to run a SVN server. Local file access or even a shared network drive will work as long as you make sure that your repository uses the Native File System format (FSFS) instead of the Berkely database.
Jan Derk
Thursday, July 27, 2006
 
 
"I mean what's difference if I have the repository on a spare machine as opposed to my development machine?"

Crashes and reboots.

If you manage to crash your development machine, you not only have to wait for SVN to restart, you may also wind up forcing SVN to do internal repairs. Please note: I don't use SVN so I don't know what it actually does in the event of crashes. I just know that a lot of databases tend to get really touchy about frequent crashes and reboots.

If you have $500 to spare, I sincerely do recommend buying one of those cheap PCs and throwing SVN on it.

Of course, the danger is that the cheap PC will fail, but that's what the backups are for. :) It's really meant to be more of a "surge protector" style protection between SVN and your chaotic development environment.
TheDavid
Thursday, July 27, 2006
 
 
"I don't use SVN so I don't know what it actually does in the event of crashes."

How often do you crash your development machine? I can't recall that happening to me unless I'm playing with hardware with dodgy drivers. Even then, nothing should happen unless you're committing to the repository exactly when it crashes. If something does happen to the current repository, just copy the backup of the previous revision in place of the current one.

SVN comes with a script that keeps any number of repository backups (hot-backup.py), and I put it in my post-commit.bat script so it's run after every commit. I have full backups of the last 64 revisions on my disk and regularly burn them to DVD. Setting up a separate machine for SVN is basically pointless unless you have other developers depending on the repository being up.
sloop
Thursday, July 27, 2006
 
 
"I mean what's difference if I have the repository on a spare machine as opposed to my development machine?"

Assuming your backups are working, it means you'll lose one days work, which may or may not be worth the cost of another machine (probably not for a solo developer).

If your backups aren't working like you thought, you might be screwed.  There are plenty of cases where people backup every night, and then a disaster comes along, they go to restore only to find out that their backups haven't been working for 6 months (if ever).  In that case, if a machine dies you'll either have your repository in working condition, or a checked out copy of your code in working condition, if you use seperate machines.

But really, only you can decide what the acceptible risks are (i.e. Do you need to account for the possibility of your house burning down, or if that happens do you have bigger problems?) and how valuable your time is vs. your money.
Grant
Thursday, July 27, 2006
 
 
You could buy an old PC for much cheaper thatn $500, too, if you were on a budget.  Directron.com has a deal right now for a PIII 933 MHx w/30gb drive and 256 MB ram for around $70.  This is good enough for a basic subversion/linux server.

My choice today, I think, would be a new Mac Mini-- I just can't justify it now!
Meganonymous Rex Send private email
Thursday, July 27, 2006
 
 
I recently spied the following article on CodeProject:

Version Control for the Standalone Programmer - Part 1
http://www.codeproject.com/useritems/XTortoiseSVN.asp
"How to set up TortoiseSVN when working by yourself."
CWuestefeld Send private email
Thursday, July 27, 2006
 
 
"How often do you crash your development machine?"

For the type of work I do, freezes and lockups are quite often such that I need to reset at the hardware level. (I'm running Windows 2000 SP4).

Lotus Notes (one of the systems I deal with) has a nasty bug involving modial dialog boxes and infinite loops; its possible to get into a situation where the Lotus Notes event handler can't process inputs, yet refuses to give control back to the operating system.

I've also crashed Microsoft Word (97 and 2000) badly enough to leave so much garbage in the system that I can't launch any software that uses an ODBC.

I've worked with Excel spreadsheets large enough to expose defective RAM chips in the sense that every time Windows tries to read from a specific memory address, it BSODs.

It's not like I crash every single day, but stuff gets screwed up often enough that when it comes to mission cricial stuff, I have a healthy appreciation for minimalistic systems. :)
TheDavid
Thursday, July 27, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz