PMS Admin
PMS Admin

Reputation: 83

Visual Studio Project Backup

Right now I am saving my all visual studio projects in C drive.

Now I want to keep copy of that all projects in some other drive, so if my C drive get crashed then also I can access all projects.

So what is best way for that.

If I just make zip of current projects from C drive and paste it in another drive.

And when needed I extract it, then will it work OR any error will come.

Thanks for help in Advance.

Upvotes: 0

Views: 23483

Answers (4)

user585968
user585968

Reputation:

If I just make zip of current projects from C drive and paste it in another drive.

Well you could do that but it's rather tedius; error-prone and rather brute-force. It's difficult to maintain history.

A better choice is to use some form of source control (SC) / software configuration management (SCM). SC is a tool for maintaining a code repository. It works by associating metadata about every source file and any changes you make.

e.g.

Source control not only keeps a copy somewhere else (ideally a different computer) but it also allows you to

  • keep track of what changed
  • rollback a change
  • share with your friends or colleges
  • integrates nicely with your IDE of choice (VS) or command-line

But in this day and age there are plenty of free cloud-based solutions that offer you more than just acting as a code repository such as stats; wikis; bug tracking; and spiffy charts. Check out:

Summary

Irrespective of whether you perform manual folder copies or use source control; both will lead to a copy of your code. However only the latter introduces workflows and due-diligence (via SCM) so that as you code you are unlikely to lose information due to the procedures and safeguards in place.

A word on file backup

If for some absolute reason you decide not to proceed with SC but rather stick with plain-old-file-backup then at least follow the fine wisdom of Scott Hanselman (MSFT) where he talks about file backup best practices:

I've got a number of backups because I practice the Backup Rule of Three.

  • 3 copies of anything you care about - Two isn't enough if it's important.
  • 2 different formats - Example: Dropbox+DVDs or Hard Drive+Memory Stick or CD+Crash Plan, or more
  • 1 off-site backup - If the house burns down, how will you get your memories back?

...using apps like CrashPlan.

Scott will most likely agree that his plan wasn't intended for source code but at least you have 3 backups of files as he recommends.

See Also

Upvotes: 7

Zhaph - Ben Duguid
Zhaph - Ben Duguid

Reputation: 26956

You could use a .zip archive to back up your work, but this is slightly laborious and will likely include a number of files you do not need to get up and running again (for example the build output, nuget packages folders, etc.) which will bloat your archives.

A better option would be to use a Version Control System of some kind, which will allow you to back up those parts of the project/solution that actually need to be backed up while ignoring the parts that can be rebuilt from the code. A good walk through of what and why can be found in Version Control By Example, which also includes comparisons about different types of VCS as well as how to perform many of the usual tasks.

There are various free options out there, based on a number of different providers. As some examples, I've used the following services, and all of them will give you a free account, and some will also give you private repositories (so that random members of the public can't see your work if that's what you want):

Using an online provider will give you the added benefit of the backups being on a third party - so if your disk fails you'll still have a backup, as well as the other benefits a VCS will provide (the ability to rollback to a specific point in time, annotations about changes, etc.).

Upvotes: 0

Anas
Anas

Reputation: 49

What will you do if hard drive crash?

Code Management is a practice and there are many tools to help you to manage your code. Try GitHub or bitbucket

Moreover you can also zip the code and save on external disks but check how much risk is involved with your code.

Upvotes: 0

rickvdbosch
rickvdbosch

Reputation: 15571

Have a look at Visual Studio Team Services. You can add code to source control (I would use Git if I were you) and manage your projects there for free.

Having your code in a source control system has many benefits, like having history of each commit.

Next to that, VSTS has lots of opions like Continuous Integration / Continuous Deployment, Testing, project management support like making your project an Agile project.

Upvotes: 0

Related Questions