[Indies] Versioning/source backups
Miscellaneous Forums/General Discussion/[Indies] Versioning/source backups
Hello
Possibly old news to a lot of people, but I've just started using
TortoiseSVN. Adds context menus for easy incremental backups of source code and assets, plus you can refer back to old backups at any time.
No more excuses for abandoning projects because you accidentally deleted it. ;)
I got no idea how to install svn... it looked on initial inspection that I had to futz around with perl... java... run apache... maybe run linux... Too much hassle.
When you move your mouse over the tortoise at the top-left, he closes his eyes.
In fact, jesus christ! - I'm going to see if there is a stuffed one on eBay.
Thanks "GfK".
You don't need any of that. Quick guide to setting it up:
1. Create a folder called "SVN Repository" (or whatever). Your backup drive/removable drive would be a good place for it.
2. Right-click the folder, choose "TortoiseSVN>>>Create Repository Here"
3. Right-click your existing dev/game folder, choose "TortoiseSVN>>>Import"
That's it. Your game is in the SVN repository and you can delete your dev/game folder (or move it somewhere else if you're paranoid and don't have another backup).
To get your stuff back out of the repository, right-click on a newly created empty folder, and choose "SVN Checkout", and use that folder as your working folder. At the end of each session, right-click the folder and choose "Commit".
That's it.
You can use the repository explorer to look at any version of your code/graphics you've ever committed, and because backups are incremental, only the changed files are saved. It doesn't backup the whole lot every time.
Only thing I would say, is don't make backups of EXEs. Since they change more often than anything else during game dev, SVN will store a new copy every time, and it can swallow up a silly amount of storage space. Same goes for the .bmx folder.
I use SVN also.
Probably this stuff is cool, but I'm still manual. Backup every mini version (like once every couple of days). Seems fine. Sometimes I get stuff out the backups so it's worth doing.
Yeah - TortoiseSVN is the dog's danglies. I switched from VSS a few years ago and I've never looked back.
VSS, oh my god. Paper backups of your code are even better than this thing.
VSS was certainly coded by Bill Gate's 5 years old nephew.
You've got another vote for SVN here.
An even simpler versioning software package I've been using for a while..
http://www.altuit.com/webs/altuit2/MagicCarpet/About.htm
I used to use svn till I switched to using Linux on my main machine. I havent really been doing enough / any coding to get round to setting it up again.
I would recommend it too. Not only for backup purposes but the advantage over manually backing up was I could take my current source and compare it with any archived version. Very handy when you make a bunch of changes and somehow manage to break something.
I've been using Tortoise for quite a while and can recommend it also.
Ok I just did what you said GfK... That's a lot slicker than what I was looking at in the subversion site. It's almost as easy as VSS.
The only thing I don't care for is that you can't have one "repository" hold multiple projects (it doesn't look like anyway). Each project has it's own.
But other than that. Pretty damn slick.
The way I understood it, you must have one repository per project, so just create a folder called "Repositories", then a subfolder for each repository. That'd work I think.
yeah that's what I've done... it's pretty nice.
Just a small note of caution - somebody over at indiegamer mentioned that TortoiseSVN shouldn't be used across networks, as loss of data can occur.
I don't see why that should be, since a network drive is treated just like any other drive.
I installed VMWare player and a pre-built Subversion virtual machine. It sits on the same PC as my dev environment, is visible to the outside world and works bloody brilliantly with TortoiseSVN.
I've never used version control or the like. I always used to just save the main source file with today's date embedded. Using a subversion server on a virtual machine is fab. I only wish I had a hosted dedicated server which I could use instead.
Just a small note of caution - somebody over at indiegamer mentioned that TortoiseSVN shouldn't be used across networks, as loss of data can occur.
I don't see why that should be, since a network drive is treated just like any other drive.
I saw the warnings for that... But I'm pretty sure it's only for the berkley databases... If you use FSFS it's fine across the network.
We use TortoiseSVN on our networks at the office for all of our projects, and it's never let us down yet. They were using it long before I joined the company (they introduced me to all things SVN), so it's a proven solution as far as I'm concerned.
Good to know, thanks!
SVN here too. Can't beat it.
It does not have to be one project per repository. You can put anything you want in the repository. I put my projects, word documents I edit often, excel spreadsheets, etc. All in one repository. What makes you think you can only put one project in it.
You can check out any subfolder into a working folder.
Explain how to do it then.
When I import more than one folder, all the files within end up all mixed up together in the same place.
same here.
I've been using SVN/Tortoise for quite a while...
Even nicer when you set up a little beastie like the NSLU2 to act as a server for it :)
http://en.wikipedia.org/wiki/NSLU2I think the worry about network use is when you used shared drives, microsoft has a nasty habit of storing up file commits, which SVN isn't expecting. When used as a network service I'm pretty sure it's ok.
I'll double check how mine is set up, as I've got multiple projects in the same repository.
I usually create the folders in the repository ahead of time with the repository browser (with TurtleSVN). But you do not have to. You can import whole directories.
Mine looks something like this:
Projects
--BlitzMax
----Cards
----Cards2
----Roids
----SpaceWar
--HGE
----Roids
----Isometric Engine
--VB
----Roids
--VB.Net
----Roids
--C#
----Roids
There are a lot more projects than that, this is just an example. I have written a version of Asteroids in every language I ever programmed in. It helps me learn the language. Especially easy since I have all of the graphics and sound files.
But, when I want to work on my Cards project under the BlitzMax directory, I only check out the cards directory and all of its subfolder into a working Dir. You can do this for just about every thing. Besides the Projects folder, I also have a Documents folder and some other stuff...
Oh, right.
Kanati, if you're reading this - I've had a play around with TortoiseSVN. When you right-click a folder and choose "import", click on the repository browse button, then make a new folder and double-click it. The folder will be imported to the new folder, and can be checked back out of there, too.
Easy when you know how. Thx Taskmaster.
ahhhh... very nice. Thanks to both of you. That goes a long way to making it as easy as source safe. :)
I don't trust automation. I just burn CDs and put them in a safe deposit box.
LOL @ Leadwerks (that was a joke, right)... ;)
One of the nice things about SVN is it is easy to back up. You can just make a copy of it, or better, you can actually tell it to duplicate itself...
I use a USB stick and zipping them to make backups... I think it's time to have a versioning software...
I've been using subversion at work and at home for ages now. At work we've used it over the internet without any big issues with a huge project in it. So it's very stable and works fine over a network.
There are only really two things I don't like about it. It's very slow at handling BIG files. And you can't check out just a single file from within a folder, you must take the entire folder (though the second one is somewhat of an abnormal case). Well, plus that it requires tech savy users. :P
A few days ago I wrote a quick system for backing up my machines at home. It's based on using rsync and hard links (sorry Windows folks, POSIX only...ok, maybe Cygwin). What it does is create snapshots of all the folders I like to back up, storing them in folders with the date the snapshot was taken at. The backup is incremental, so only takes up as much space as a complete copy of the original, plus any files that have changed, for each backup.
It's one of my first shell script so be kind. :) This code works on my iBook running Tiger (it did not work on Ubuntu, had to modify it a bit for that).
#!/bin/sh
# Quick backup hack by Ragnar Brynjulfsson
# - Please note that there is very little error checking here, so use at your own risk.
# - The script makes incremental copies in seperate folders, marking them with the current time and date.
# - Only the files that have changed are stored each time, the rest are hard linked to earlier copies.
# - You can delete folders containig older versions at any time to save disk space, just leave the latest one if you don't want to loose your backup.
# Change backupsource to point to the folder you want to backup.
backupsource="/Users/yourname"
# Change backupdestination to where you want to store your backup.
backupdestination="/Volumes/mac_backup"
# Text file containing files and folders to exclude from the backup.
exclude="/Users/ragnar/Backup/exclude.txt"
date=`date`
if [ -d $backupdestination ]
then
echo "Starting backup of $backupsource to $backupdestination/$date"
else
echo "Destination folder $backupdestination does not exist. Please create it."
exit 0
fi
olddate=0
newdate=0
for i in $backupdestination/*
do
if [ -d "$i" ]
then
newdate=$(stat -f %Uc "$i")
fi
if [ $newdate > $olddate ]
then
version="$i"
olddate=$newdate
fi
done
mkdir "$backupdestination/$date"
if [ "$backupdestination/*" == "$version" ]
then
echo "Making initial copy of $backupsource...this may take a while."
rsync -avx --exclude-from="$exclude" "$backupsource/" "$backupdestination/$date"
else
echo "Creating hard link copy of previous version ($version)."
rsync -avx --exclude-from="$exclude" --link-dest="$version" "$backupsource/" "$backupdestination/$date"
echo "Doing incremental backup of $backupsource to $backupdestination/$date."
rsync -avxu --exclude-from="$exclude" "$backupsource/" "$backupdestination/$date"
fi
exit 0
The exlclude.txt file, is simple a text file with a one line for each folder/file you don't want to back up (relative to your backupsource path).
Cheers,
Ragnar
Bought an external hard drive enclosure today and stuck my 200GB hard drive in it. Created a repository on there and everything's working great. I can hook it up to any of my PCs via USB.
Wish I'd done this years ago.
I have a Western Digital External Hardrive, it was like £60 and it's as fast as a normal drive via USB, I've written a backup batch file that I just hit every so often. Also I can plug it into the mac or other computers. It rocks. Way better than memory sticks (if a bit larger and needing a power supply of course).
Am downloading TortoiseSVN and installing now. Thanks for this Gfk, some good advice - I've been versioning between notepad/word docs which has it's limitations, it'll be handy to have a formal versioning control system.
Finally got around to trying TortoiseSVN, as versioning tools / diff tools go it's phenomenally intuitive. Gets my vote.... {;-).
I tend to err on the 'leave some code in that may prove useful again...' TortoiseSVN helps you to archive quickly with no grief.
Have used VSS at work... that's the dogs doo doos....
SVN gets another vote for being dogs danglies from me {;-)
Microsoft has a very nice free tool called 'SyncToy' which allows you to synchronize any pair of folders/drives.anywhere from a full 2-way sync to a one-directional only adding changes.
Very nice, and can work with the windows scheduler to automate it.
Even better in combination with the 3rd party tools 'WebDrive' which can map a driveletter to an FTP site, so you can sync your important folder(s) to an FTP server if you have one. (My webspace comes with a couple of gigs of space, so plenty of room to automatically back up some local files in a dedicated area as well)