Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Tutorial: Syncing your mod with Dropbox  (Read 7135 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Tutorial: Syncing your mod with Dropbox
« on: June 15, 2012, 08:01:10 AM »

I'll try to keep this tutorial as simple as possible so that anyone can follow along, regardless of tech savvyness.

One of the most devastating things that can happen to a developer is data loss. It happens all the time: computer theft, component failure, power surge, fires, etc. If you want to protect yourself from such things, you'll want to have an offsite backup. Dropbox is by far the simplest solution. Here's how to use it.


What is Dropbox?

Basically, Dropbox is a program that runs on your computer, constantly scanning a directory you set up when you installed it. Whenever anything changes in that directory (adding, removing, renaming, or otherwise modifying files), it uploads the changes to your private storage on the central server. You can access all the files on your account through linked computers, a web interface, or even from a smartphone. Dropbox gives you two gigabytes of storage (which can be expanded by 500 megabytes for every person you successfully refer to the service), and allows you to share folders with other people. It's excellent for small mod teams. And it's free!


Why not just use a real source code management system like Git, SVN, or Mercurial?

Well, if you know what those are then this tutorial isn't really for you. For most users, though, the headache of setting up and using a repository isn't worth it, and they would be overkill for small projects anyway.


So how do I set up Dropbox?

First, you need to download the client from the Dropbox website. Run the installer, follow the instructions and create an account. It's extremely user-friendly.

If you want to share a specific folder with others (like mod team members), go here and right click on the folder you want to share and select "invite to folder" (if it's already shared, this will be replaced with "shared folder options"). You will either need the other person's e-mail address, or if you hooked in your Facebook account, to be friends with them.

Keep note of where your Dropbox sync directory is (right click on the Dropbox tray icon and click Preferences). Any files you place in this directory will be uploaded to the Dropbox servers. Any changes you make to them will also be synched. Don't worry about constantly uploading tiny changes, Dropbox gives you something crazy like 30 gigabytes of bandwidth per day.


But my mod files need to be in the Starfarer directory to work! Won't constantly copying the files over to Dropbox be a huge pain in the ass?

Ah, this is where the magic begins. We're going to use the mklink command to create a directory junction. In laymans terms, we're going to tell the operating system to make it so the same directory can be in two different places at the same time. This way, the mod files will be in both the Starfarer directory and the Dropbox directory.

Note that the method I'm using only works in Vista and above. You can do this in XP, but the command is different. I'll do some research and add that method into the post later.


mklink? Junctions? This techno-wizardry isn't going to fry my computer, is it?

Don't worry, it's perfectly safe*. The junction is completely invisible to programs; it functions identically to a normal folder in both locations. A common use for junctions is to move Steam games (which are otherwise unmoveable) onto another hard drive when you are getting low on space. I personally have about a dozen junctions in use on my system right now, and I've never had a problem.

*Note: in versions of Windows before Vista, deleting a junction point deletes the original folder as well. You have to remove the link manually from a command prompt to avoid this. I'll edit in instructions for that later as well. If this does happen to you, Dropbox stores all file changes within the last thirty days, so you can easily recover any lost files.


OK, I'm convinced. How do I do this?

First, move (not copy) your mod folder into a folder in the Dropbox sync directory. The Dropbox files will be the real thing from now on, and Starfarer will be using the junction to reach them. Keep note of BOTH directory paths: the one you just moved from, and the one you moved to. For example, I would have moved the folder "C:\Users\Rob\Programs\Starfarer\mods\LW Personal Mod" to the new path "C:\Users\Rob\Dropbox\Starfarer\LW Personal Mod". Paste your paths into Notepad or something, you'll need them soon.

Next, we'll need an elevated command prompt. To do this, open the Start menu and type "cmd" into the search bar. You should see a cmd.exe appear; right click it and hit "Run as administrator". If you don't see it here (or turned off the search bar), you can find cmd.exe in C:\Windows\System32.

The syntax you will need to use is "mklink /J <old folder path> <new folder path>", replacing the bracketed bits with the actual paths. Both paths must be enclosed in quotation marks.

For example, here's the command I used (your paths will be different, obviously):
Code
mklink /J "C:\Users\Rob\Programs\Starfarer\mods\LW Personal Mod" "C:\Users\Rob\Dropbox\Starfarer\LW Personal Mod"

If all went as planned, your prompt window should look something like this:


Your folder should have reappeared in its old Starfarer location with a shortcut icon overlayed over it, and you should be able to double click the folder in either location and get to the same place. Congratulations, you don't have to worry about losing your mod files anymore!

If something went wrong, post in the comments and I'll try to help you out.
« Last Edit: June 15, 2012, 09:10:41 AM by LazyWizard »
Logged

Griffinhart

  • Commander
  • ***
  • Posts: 169
    • View Profile
Re: Tutorial: Syncing your mod with Dropbox
« Reply #1 on: August 25, 2012, 11:39:18 PM »

Note that SpiderOak does what Dropbox does (i.e., web/cloud-based storage and backup) but also touts secure encryption.

Also, unlike Dropbox, you don't need to keep everything in a single root directory, so you don't have to move your files into any "SpiderOak" directory (unless you want to) and use mklink/create junctions/symlinks. SpiderOak lets you specify what directories (in fact, what files) to keep backed up and synced.

SpiderOak is also compatible with Mac and Linux; I can't remember if Dropbox is or not.

My referral link. If you join SpiderOak through that, I get a free GB (up to 10) of storage space, and so do you. New, free accounts start at 2GB (or 3GB, if you use a referral link).

-- Griffinhart
Logged


"Rrha ki ra tek wim tes yor
en weel waath dius manaf, Yat!
"