<p>I'm curious about keeping source code around reliably and securely for several years. From my research/experience:</p>

<ol>
<li><p>Optical media, such as burned DVD-R's lose bits of data over time. After a couple years, I don't get all the files off that I put on them. Read errors, etc.</p></li>
<li><p>Hard drives are mechanical and subject to failure/obsolescence with expensive data recovery fees, that hardly keep your data private (you send it away to some company).</p></li>
<li><p>Magnetic tape storage: see #2.</p></li>
<li><p>Online storage is subject to the whim of some data storage center, the security or lack of security there, and the possibility that the company folds, etc. Plus it's expensive, and you can't guarantee that they aren't peeking in.</p></li>
</ol>

<p>I've found over time that I've lost source code to old projects I've done due to these problems. Are there any other solutions?</p>

<p><em>Summary of answers:</em><br>
1. Use multiple methods for redundancy.<br>
2. Print out your source code either as text or barcode.<br>
3. RAID arrays are better for local storage.<br>
4. Open sourcing your project will make it last forever.<br>
5. Encryption is the answer to security.<br>
6. Magnetic tape storage is durable.<br>
7. Distributed/guaranteed online storage is cheap and reliable.<br>
8. Use source control to maintain history, and backup the repo.</p>

[{'answer_id': 73758, 'author': 'Chris Upchurch', 'author_id': 2600, 'author_profile': 'https://Stackoverflow.com/users/2600', 'pm_score': 2, 'selected': False, 'text': '<p>Any data you want to keep should be stored in multiple places on multiple formats.  While the odds of any one failing may be significant, the odds of all of them failing are pretty small.</p>\n'}, {'answer_id': 73768, 'author': 'Alex Fort', 'author_id': 12624, 'author_profile': 'https://Stackoverflow.com/users/12624', 'pm_score': 2, 'selected': False, 'text': "<p>If you want to archive something for a long time, I would go with a tape drive. They may not hold a whole lot, but they are reliable and pretty much the storage medium of choice for data archiving. I've never personally experienced dataloss on a tape drive, however.</p>\n"}, {'answer_id': 73771, 'author': 'deemer', 'author_id': 11192, 'author_profile': 'https://Stackoverflow.com/users/11192', 'pm_score': 3, 'selected': False, 'text': "<p>Based on your level of paranoia, I'd recommend a printer and a safe.</p>\n\n<p>More seriously, a RAID array isn't so expensive anymore, and so long as you continue to use and monitor it, a properly set-up array is virtually guaranteed never to lose data.</p>\n"}, {'answer_id': 73777, 'author': 'Frank Wiles', 'author_id': 12568, 'author_profile': 'https://Stackoverflow.com/users/12568', 'pm_score': 4, 'selected': True, 'text': '<p>The best answer is "in multiple places".  If I were concerned about keeping my source code for as long as possible I would do: </p>\n\n<p>1) Backup to some optical media on a regular basis, say burn it to DVD once a month and archive it offsite. </p>\n\n<p>2) Back it up to multiple hard drives on my local machines </p>\n\n<p>3) Back it up to Amazon\'s S3 service.  They have guarantees, it\'s a distributed system so no single points of failure and you can easily encrypt your data so they can\'t "peek" at it. </p>\n\n<p>With those three steps your chances of losing data are effectively zero. There is no such thing as too many backups for VERY important data. </p>\n'}, {'answer_id': 73788, 'author': 'Vinko Vrsalovic', 'author_id': 5190, 'author_profile': 'https://Stackoverflow.com/users/5190', 'pm_score': 2, 'selected': False, 'text': '<p>The best way to back up your projects is to make them open source and famous. That way there will always be people with a copy of it and able to send it to you.</p>\n\n<p>After that, just care of the magnetic/optical media, continued renewal of it and multiple copies (online as well, remember you can encrypt it) on multiple media (including, why not, RAID sets)</p>\n'}, {'answer_id': 73789, 'author': 'Jan Krüger', 'author_id': 12471, 'author_profile': 'https://Stackoverflow.com/users/12471', 'pm_score': 0, 'selected': False, 'text': '<p>One way would be to periodically recycle your storage media, i.e. read data off the decaying medium and write it to a fresh one. There exist programs to assist you with this, e.g. <a href="http://www.dvdisaster.com/" rel="nofollow noreferrer">dvdisaster</a>. In the end, nothing lasts forever. Just pick the least annoying solution.</p>\n\n<p>As for #2: you can store data in encrypted form to prevent data recovery experts from making sense of it.</p>\n'}, {'answer_id': 73790, 'author': 'Gilligan', 'author_id': 12356, 'author_profile': 'https://Stackoverflow.com/users/12356', 'pm_score': 0, 'selected': False, 'text': '<p>I think Option 2 works well enough if you have the write backup mechanisms in place. They need not be expensive ones involving a third-party, either (except for disaster recovery).\nA RAID 5 configured server would do the trick. If a hard drive fails, replace it. It is HIGHLY unlikely that all the hard drives will fail at the same time. Even a mirrored RAID 1 drive would be good enough in some cases.</p>\n\n<p>If option 2 still seems like a crappy solution, the only other thing I can think of is to print out hard-copies of the source code, which has many more problems than any of the above solutions. </p>\n'}, {'answer_id': 73796, 'author': 'Flint', 'author_id': 11877, 'author_profile': 'https://Stackoverflow.com/users/11877', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>Online storage is subject to the whim of some data storage center, the security or lack of security there, and the possibility that the company folds, etc. Plus it\'s expensive,</p>\n</blockquote>\n\n<p>Not necessarily expensive (see <a href="http://www.rsync.net/" rel="nofollow noreferrer">rsync.net</a> for example), nor insecure. You can certainly encrypt your stuff too.</p>\n\n<blockquote>\n  <p>and you can\'t guarantee that they aren\'t peeking in.</p>\n</blockquote>\n\n<p>True, but there\'s probably much more interesting stuff to peek at than your source-code. ;-)</p>\n\n<blockquote>\n  <p>More seriously, a RAID array isn\'t so expensive anymore</p>\n</blockquote>\n\n<p>RAID is <em>not</em> backup.</p>\n'}, {'answer_id': 73808, 'author': 'pjz', 'author_id': 8002, 'author_profile': 'https://Stackoverflow.com/users/8002', 'pm_score': 1, 'selected': False, 'text': "<p>The best home-usable solution I've seen was printing out the backups using a 2D barcode - the data density was fairly high, it could be re-scanned fairly easily (presuming a sheet-feeding scanner), and it moved the problem from the digital domain back into the physical one - which is fairly easily met by something like a safe deposit box, or a company like Iron Mountain.</p>\n\n<p>The other answer is 'all of the above'.  Redundancy always helps.  </p>\n"}, {'answer_id': 73815, 'author': 'Jordan Mack', 'author_id': 9979, 'author_profile': 'https://Stackoverflow.com/users/9979', 'pm_score': 1, 'selected': False, 'text': '<p>For my projects, I use a combination of 1, 2, &amp; 4. If it\'s really important data, you need to have multiple copies in multiple places. My important data is replicated to 3-4 locations every night.</p>\n\n<p>If you want a simpler solution, I recommend you get an online storage account from a well known provider which has an insured reliability guarantee. If you are worried about security, only upload data inside <a href="http://www.truecrypt.org/" rel="nofollow noreferrer">TrueCrypt</a> encrypted archives. As far as cost, it will probably be pricey... But if it\'s really that important the cost is nothing.</p>\n'}, {'answer_id': 73872, 'author': 'Adam Hopkinson', 'author_id': 12280, 'author_profile': 'https://Stackoverflow.com/users/12280', 'pm_score': 2, 'selected': False, 'text': '<p>I think you\'d be surprised how reasonably priced online storage is these days. Amazon S3 (simple storage solution) is $0.10 per gigabyte per month, with upload costs of $0.10 per GB and download costing $0.17 per GB maximum.</p>\n\n<p>Therefore, if you stored 20GB for a month, uploaded 20GB and downloaded 20GB it would cost you $8.40 (slightly more expensive in the European data center at $9).</p>\n\n<p>That\'s cheap enough to store your data in both US and EU data centers AND on dvd - the chances of losing all three are slim, to say the least.</p>\n\n<p>There are also front-ends available, such as JungleDisk.</p>\n\n<p><a href="http://aws.amazon.com" rel="nofollow noreferrer">http://aws.amazon.com</a><br>\n<a href="http://www.jungledisk.com/" rel="nofollow noreferrer">http://www.jungledisk.com/</a><br>\n<a href="http://www.google.co.uk/search?q=amazon%20s3%20clients" rel="nofollow noreferrer">http://www.google.co.uk/search?q=amazon%20s3%20clients</a></p>\n'}, {'answer_id': 73952, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>For regulatory mandated archival of electronic data, we keep the data on a RAID and on backup tapes in two separate locations (one of which is Iron Mountain). We also replace the tapes and RAID every few years.</p>\n'}, {'answer_id': 74627, 'author': 'skamradt', 'author_id': 9217, 'author_profile': 'https://Stackoverflow.com/users/9217', 'pm_score': 1, 'selected': False, 'text': '<p>If you need to keep it "forever" probably the safest way is to print out the code and stick that in a plastic envelope to keep it safe from the elements.  I can\'t tell you how much code I\'ve lost to a backup means which are no longer reachable.... I don\'t have a paper card reader to read my old cobol deck, no drive for my 5 1/4" floppies, or my 3 1/2" floppies.  but yet the print out that I made of my first big project still sits readable...even after my once 3 year old decided that it would make a good coloring book.</p>\n'}, {'answer_id': 74732, 'author': 'Tim', 'author_id': 387361, 'author_profile': 'https://Stackoverflow.com/users/387361', 'pm_score': 0, 'selected': False, 'text': "<p>I was just talking with a guy who is an expert in microfilm.  While it is an old technology, for long term storage it is one of the most enduring forms of data storage if properly maintained.  It doesn't require sophisticated equipment (magifying lens and a light) to read altough storing it may take some work.</p>\n\n<p>Then again, as was previously mentioned, if you are only talking in the spans of a few years instead of decades printing it off to paper and storing it in a controlled environment is probable the best way.  If you want to get really creative you could laminate every sheet!</p>\n"}, {'answer_id': 74758, 'author': 'icelava', 'author_id': 2663, 'author_profile': 'https://Stackoverflow.com/users/2663', 'pm_score': 1, 'selected': False, 'text': '<p>When you state "back up source code", I hope you include in your meaning the backing up of your version control system too.</p>\n\n<p>Backing your current source code (to multiple places) is definitely critical, but backing up your history of changes as preseved by your VCS is paramount in my opinion. It may seem trivial especially when we are always "living in the present, looking towards the future". However, there have been way too many times when we have wanted to look backward to investigate an issue, review the chain of changes, see who did what, whether we can rollback to a previous build/version. All the more important if you practise heavy branching and merging. Archiving a single trunk <em>will not do</em>.</p>\n\n<p>Your version control system may come with documentation and suggestions on backup strategies.</p>\n'}, {'answer_id': 74792, 'author': 'Sleep Deprivation Ninja', 'author_id': 13002, 'author_profile': 'https://Stackoverflow.com/users/13002', 'pm_score': 2, 'selected': False, 'text': '<p>Don\'t forget to use Subversion (<a href="http://subversion.tigris.org/" rel="nofollow noreferrer">http://subversion.tigris.org/</a>). I subversion my whole life (it\'s awesome).</p>\n'}, {'answer_id': 77253, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Drobo for local backup</p>\n\n<p>DVD for short-term local archiving </p>\n\n<p>Amazon S3 for off-site,long-term archiving</p>\n'}]
['https://Stackoverflow.com/questions/73745', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1892/']