Migrating Druva inSync servers


When you’re asked to help migrate a whole bunch of Druva inSync users from internal servers to the cloud, you don’t think too much of it.


When you wait nearly three weeks for a migration script that doesn’t come (and what you’ve seen won’t work), you get tinkering. So without further ado, let me present:

Druva inSync Server Migration Script!

Now, what does it actually do and how do you use it?

Ok the product sadly commits two basic errors that cause Mac Admins like ourselves to go slowly nuts and tear our hair out. Well maybe in your case, i’ve lost all mine. These errors are to use a non standard (for OS X) preference file format and to store preferences on a per user basis. That means none of the standard OS X tools will work (defaults, i’m looking at you!) and you have to modify things on a per-user account basis. Neither of which anyone likes. *swallows disgust for a moment*

For example, the .cfg (!) file it uses looks a lot like this:

PHOTOS = False
SID = (None, None)

Not pleasant huh? There’s a lot more stuff than that. Thankfully there’s a tool that can do this, and it isn’t python. Welcome to the fore, sed .. or the stream editor. Not the easiest thing to use but perfect for this job.

Now the actual command that does the work on script line 64 looks a bit like this:

sed $’s/SERVERS =.*/SERVERS = [\x27server.address:port\x27]/’

What we’re doing is to tell sed to look for the line that begins “SERVERS =” and then replace it entirely with “SERVERS = [‘server.address:port’]” (Ignore the double quotes, that’s for clarity).

There’s some extra code in there to go around any extra user accounts you may have on the system as well as full local logging for later diagnostics. I’ll be deploying this as soon as I get the ok.

Warning! You will have to substitute the server address on line 64 and the token (if needed) on line 65 for this to work. Deployment is left to your own best practices.