     json = @toJson(id)
     if args?.callback?
       json = args.callback(json) ? json
-    @fromJson(json).then (idMaps) ->
-      console.log 'idMaps', JSON.stringify(idMaps)
+    @fromJson(json, args).then (idMaps) ->
       newProjectId = idMaps[Collections.getName(Projects)]?[id]
       Logger.info('Duplicated project', id, 'to new project', newProjectId)
       return idMaps

        # TODO(aramk) Disabling validation is dangerous - only done here to avoid validation
        # errors which don't have messages at the moment. Improve collection2 to provide the
        # message returned from the validate method.
        collection.direct.insert model, (err, result) ->
          if err
            createDf.reject(err)
          else

    allCreatePromise.then Meteor.bindEnvironment ->
      _.each idMaps, (idMap, name) ->
        collection = collectionMap[name]
        method = collection.direct.update if args.useDirect
        method ?= collection.update
        _.each idMap, (newId, oldId) ->
          newModel = collection.findOne(newId)
          modifier = SchemaUtils.getRefModifier(newModel, collection, idMaps)
          if Object.keys(modifier.$set).length > 0
            refDf = Q.defer()
            refDfs.push(refDf.promise)
            method.call collection, newId, modifier, (err, result) ->
              if err
                refDf.reject(err)
              else
