dcsimg
Results 1 to 6 of 6

Thread: Basic Source Code Backup

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    311

    Basic Source Code Backup

    We are trying to start a very basic source code backup system for our in-house code. As almost all of our programs are just written by 1 developer, we're not too concerned about version control and checking projects in and out; rather this is more for disaster recovery where we just want to store the source code off site in case, say a tornado takes out our building, we'd have a way to get back our code. We have a server off site that we can all access, so we're planning to use that as our backup destination. But because the space on that server might be limited (esp. in the future if we decide to go this route), we want to just have a backup of what would be absolutely necessary to recreate the program after a disaster, and not extraneous files like the compiled program. Essentially the plan is to create a virtual drive out to that off-site server and on a weekly basis just copy the necessary source files to that drive, probably just using Robocopy to do the actual copying of the files. So my question is, what would be the necessary files to copy over from my projects? I assume all *.vb files, but I'm more unsure of the others like the .vbproj (and .vbproj.user), .resx, app.config, .sln, or any files in any other folders like the bin, obj, or My Project folder...

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,335

    Re: Basic Source Code Backup

    Surely this is a question your developer could answer? HDD space is so cheap now a days i would strongly suggest backup each folder contents.

  3. #3
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,911

    Re: Basic Source Code Backup

    And even if you don't "need" version control, it can still be pretty useful to simplify your backups.
    There are multiple choices out there, but the one I'm most familiar with is SVN.
    Even though I'm pretty much the single developer for the software I'm working on now, having it in a repository does actually simplify things.
    In SVN you checkout a working copy, and then simply keep it, so you usually never have to checkout another working copy unless you want to work from more than one machine.

    The type of programming I do usually involves communication with a number of other computers on an LAN, so I can't test everything on my development machine as it isn't connected to the LAN. When I finish a set of changes that I would like to test out fully, I just do a check-in, which SVN knows what files have been changed, and which haven't, so only sends the modified files to the server.
    I also have a working copy on a machine that is on the LAN, so there I simply do an svn update and it pulls down only those files that have been modified since the last update.
    I run a batch file which rebuilds everything, then run and test the code in its environment. If there is an issue, I can debug the code on that machine, and if I find the problem, can fix it right there.
    When everything is working as desired, I just do an svn checkin and it know what files have been modified and updates them on the server. I can then go back to my desk, do an svn update, and the changed files are updated in my working copy, so it match what is on the other LAN. It only takes a few seconds to do a simple check-in whenever I want, and I don't have to keep track of what files have change, and I can also go back to previous versions of the program if I needed to, but that is not a common case.

    The convenient part, is that the code is essentially backed up in the repository without any real effort on my part once I've checked in the original code and checked out a working copy to do my work in. Only the changes are transferred to the repository, so cuts down on doing bulk copying of whole directories, and the repository is 90 miles away from where I'm working so not likely that some disaster can take us both out.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    311

    Re: Basic Source Code Backup

    "Developer" as in the person developing this backup process or the off-site server's developer? We don't have any control about the amount of space we get allocated from this off-site server so even though I'd normally agree, with possible size issues, we'd rather just copy over the source code and anything else needed to recreate the working program if all goes to hell. Also there are only 3 programmers and I am the only one that code in .Net, so the developer that devised the backup process doesn't know what files are important and what don't need to be copied, which is why I'm asking here. I know I'll need the .vb files and I'm pretty sure that the bin folder contains everything that VS builds so that folder can be excluded. But I'm not sure if just the .vb files are good enough, or if there is other data inside some of the other files that I'd need to keep too.

  5. #5
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,911

    Re: Basic Source Code Backup

    I usually just do some empirical trials.
    Copy the solution/project tree to another directory, delete the obj and bin directories, then try to build it to see if it will run.
    If it runs, exit out, delete the obj and bin directories again, then remove other files that you think might not be needed (i.e .suo), probably starting with the larger ones first, since they will make the most difference (.pdb files if you have them). .resx files are usually necessary.
    If you get rid of the .bin and .obj directories, that will be one of the simplest and more size reduction effective thing right off the bat.
    You can also try doing a Clean Solution from the build menu to see what the IDE gets rid of.

  6. #6
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,335

    Re: Basic Source Code Backup

    Quote Originally Posted by Pyth007 View Post
    "Developer" as in the person developing this backup process or the off-site server's developer? We don't have any control about the amount of space we get allocated from this off-site server so even though I'd normally agree, with possible size issues, we'd rather just copy over the source code and anything else needed to recreate the working program if all goes to hell. Also there are only 3 programmers and I am the only one that code in .Net, so the developer that devised the backup process doesn't know what files are important and what don't need to be copied, which is why I'm asking here. I know I'll need the .vb files and I'm pretty sure that the bin folder contains everything that VS builds so that folder can be excluded. But I'm not sure if just the .vb files are good enough, or if there is other data inside some of the other files that I'd need to keep too.
    But any developer knows how to research regardless of the language. Regardless of what language i wrote in i'd back up each directory to the full.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width