53

Is it a bad idea to use Dropbox as a backup system for Subversion repositories?

Has anyone tried using Subversion with an an online file sharing utility like Dropbox? What's your experiences?

My concern is whether this will work - mainly because Subversion maintains locks and it's very specific about it. I'm not sure if Dropbox and Subversion can both work together?

p.s. I'm thinking of using this for my Xcode projects, and no, i don't want to use github because it's not free - you can't keep your repositories Private with the free account (and other reasons).


References:

Dropbox (file sync, sharing, and online backup)

Subversion (open source version control system)

Dan
  • 6,008
  • 7
  • 40
  • 41
Mustafa
  • 20,504
  • 42
  • 146
  • 209
  • 2
    I think you are confusing Git with one of the Git hosting services. Github, perhaps? – JesperE Jan 20 '10 at 08:06
  • 4
    For the record, `git` is free: http://git-scm.com. Github, is not for private repositories. You can even use `git` without a remote server. – Doug Neiner Jan 20 '10 at 08:06
  • 1
    You should really look at Mercurial (or another DVCS such as git as already suggested) - sounds like a much better fit for you, and I don't know why you would want to choose Subversion if starting out today. – GraemeF Jan 20 '10 at 08:22
  • Yes, i meant Github. Git is almost the same as Subversion. @GraemeF, Why is subversion not a better fit in my case? – Mustafa Jan 21 '10 at 12:15
  • A lot of people are migrating away from Subversion (or wish they could) because DVCS are so much more flexible. Have a Google. :) – GraemeF Jan 21 '10 at 15:33
  • Resistance to GIT is very comprehensible. I've heard Mercurial is a better upgrade from SVN as its default interface will facilitate merges and working in a group. But bare in mind GIT is not almost same as SVN. It is to SVN like SVN was to CVS. – cregox Feb 14 '11 at 22:27
  • I'd say it is to SVN as SVN was to VSS! – Rob Grant Aug 27 '12 at 15:32
  • Why is SVN on Drobbox a good idea? What do you get? – Kugel Dec 27 '12 at 03:44
  • I put my SVN directories into Dropbox the other day and now I have some really bad and strange corruption things happening... but I really shouldn't be surprised. I used Tortoise SVN (version 1.7.7) in Windows with R Studio (which also manages the repo via Silk SVN)... but I synced to a Ubuntu computer that was SVN 1.6. Now I have many empty files that shouldn't be empty. Reverting doesn't work, but a fresh checkout seems to be ok or manually restoring with Dropbox works too. – geneorama Aug 29 '13 at 03:50

10 Answers10

32

I've got Dropbox, SVN and Xcode working fine here, I've had no problems what so ever.

You don't even need to be careful about which machine you commit/update from as Dropbox keeps EVERYTHING synchronised.

James
  • 5,812
  • 5
  • 26
  • 30
  • 2
    How about when more that one people are working on a project and they are both continuously committing changes to the Subversion repository and fetching updates as well? I fear that subversion may experience locking issue OR DropBox may experience locking issue while updating. Any thoughts on that? – Mustafa Jan 21 '10 at 12:17
  • 4
    I only use Dropbox to keep 2 machines synchronised so I can't really comment but I can't see why there would be any problems, all Dropbox does is sync any changes files, it doesn't seem to hold any locks on them. I wouldn't however want to use Dropbox to sync source code between a team, there is no versioning or blame/praise logs. – James Jan 21 '10 at 13:02
  • yet... That's dropbox next step to conquer the world (I hope). :P – cregox Feb 14 '11 at 22:22
  • There is no next step, Dropbox *already* conquered the world :) – SkyWalker May 07 '13 at 18:25
  • Wao.. Could you please how I can setup Dropbox, SVN and Xcode. I am new in subversioning. thanks – user777304 Feb 22 '14 at 16:39
12

My suggestion is to use dropbox together with an encryption tool such as TrueCrypt. In this way you would have a safe storage on the cloud.

SVN works perfectly in a TrueCrypt disk.

If you need to access the repository at the same time on multiple location I would recommend of using a subversion host provider. DropBox can get confused if two persons are modifying the same file at once.

http://wiki.dropbox.com/TipsAndTricks/IncreasePrivacyAndSafety

http://www.randomwire.com/storing-sensitive-data-in-the-cloud

dawez
  • 2,714
  • 2
  • 29
  • 50
  • If security is a concern, You could also put your SVN repository onto an encrypted disk image that you could then put on the dropbox :) – BadPirate Jun 07 '11 at 17:56
  • Just found this one today: http://www.webupd8.org/2011/06/encrypt-your-private-dropbox-data-with.html . Encfs. Seems to be quite close what I was looking for [you can encrypt specific folders of your Dropbox]. – dawez Jun 08 '11 at 21:36
  • update to previous comment: When using ENCFS with dropbox be sure that the dropbox and encfs are started in the right order otherwise disasters can happen. More info : http://forums.dropbox.com/topic.php?id=15065 – dawez Mar 18 '12 at 17:58
  • If you mean to create a TrueCrypt encrypted file container, then the potential issue with that is that a very large file would have to be re-uploaded for every small modification, unless Dropbox is able to send only the changed parts of the file. – SimonT Jan 01 '14 at 14:49
  • 1
    @SimonT seems that dropbox is just [uploading the changed part](http://serverfault.com/questions/52861/how-does-dropbox-version-upload-large-files). However a small change inside a file that is contained in a encrypted disk, can result in a larger change. – dawez Oct 23 '14 at 08:30
4

Why to use SVN inside Dropbox? Instead, you can use your own SVN server with Dropbox-like interface: EasySVN from Assembla or IQBox-SVN.

niutech
  • 28,923
  • 15
  • 96
  • 106
4

May be this will help you. I have put SVN Reposiroty inside of a Dropbox Folder. http://foyzulkarim.blogspot.com/2012/12/dropbox-as-svn-repository.html

Foyzul Karim
  • 4,252
  • 5
  • 47
  • 70
2

You can simply exclude the .svn-Folder from Dropbox: (instructions for Mac)

  1. You need to see the .svn-Folder, so go into Terminal and execute

    defaults write com.apple.Finder AppleShowAllFiles YES
    killall Finder
    
  2. Go to your Folder an Copy the .svn-Folder somewhere else

  3. Go to your Dropbox-Preferences > Advanced > Selective Sync and deactivate to .svn-Folder

  4. The Folder should now be deleted from your HD and Dropbox, you can check that on the website.

  5. Put your copy of the .svn-Folder back into the directory. You should see a little gray sign like (-)

  6. Revert step 1 with

    defaults write com.apple.Finder AppleShowAllFiles NO
    killall Finder
    
  7. That's it!

Jannik Arndt
  • 447
  • 5
  • 13
1

i got problems when use Dropbox to sync svn repository, once Dropbox failed to access one file, the file doesn't be synced again. then, the svn structure was been destroyed...

Cooper.Wu
  • 4,335
  • 8
  • 34
  • 42
1

I think it will probably work out OK if you're not accessing the repository from different locations, and let is synchronize before using it. It doesn't seem like a very stable solution though.

Is there any reason you can't us a publicly available URL for your repository?

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
1

Depending on how many files you are syncing it may end up doing a lot of file transferring. (Remember, you only have 200MB on Dropbox without any additional storage bonuses on the free account.) This means all the .svn (or _svn) files will also be synced, in effect doubling the amount of files it needs to keep updated.

If you don't need to move whole directories around in your tree once the initial sync is complete, then transfers should be respectable.

I've tried this myself for some projects and it worked okay, but in the end I think the best way to use Subversion repositories and Dropbox together is to use them for deployment builds. I wouldn't just set Dropbox to sync with my working folder. Use Dropbox to sync up at the end of the day by copying in the working folder to the actual Dropbox folder at scheduled intervals, thereby limiting the amount of constant network traffic the former might incur.

0

See SVN Backups to Dropbox. This generates full or incremental dumps of the SVN repository and uploads the compressed result to Dropbox. The main advantage of this approach is that it does NOT use the Dropbox client software. The Dropbox client software synchronizes between your computer and the cloud, and a corrupted file would be synchronized. You can create a cronjob (or Windows scheduled task) to run this script every day/week/month/etc.

0

Not the trivial way...

First idea is always "okay, let's keep the repo on Dropbox and it will do the rest". Nope. This combo will always give you locking problems, just as you expected. I tried because I love svn's simplicity but I ended up moving some of my repos to git, just to make the sync flawless.

Now I'm still not a git fan (after a few years of inevitable use because of my clients' version control choices) so here's a few ideas to not do what I did:

What you can do instead

  1. RiouxSVN
    There's a very good (and surprisingly, free) svn hosting service: https://riouxsvn.com/ - it's a no-nonsense way to keep your repos somewhere safe, physically detached from your computer, available anywhere as long as you have a connection. So basically, what I guess you wanted to achieve with DropBox.

  2. Post-commit
    You can easily create a post-commit batch that copies your local repository to DropBox. Make it a differential mirror, a built-in tool called robocopy can take care of that for you. This way you'll always have a safe instance in the sky.

  3. Distract DropBox sync
    This is merely a dirty trick if nothing else seems to work - a pre-commit hook with a big file copy, to cause a noticeable delay for DropBox and prevent simultaneous opening of the same files svn are working on. Not recommended if you have a better option.

UPDATE 2022

Trying SVN + Dropbox again, so far no problems

UPDATE 2023

It works ever since update 2022

dkellner
  • 8,726
  • 2
  • 49
  • 47