Пример #1
0
        private static void Execute(FlexibleOptions options)
        {
            logger.Debug("Start");

            // Parsing Arguments - Sanity Check
            ParseArguments(options);

            logger.Debug("Opening connections...");

            CheckConnections(options);

            // Reaching Databases
            MongoServer sourceDatabase = MongoDbContext.GetServer(options.Get("source"));
            MongoServer targetDatabase = MongoDbContext.GetServer(options.Get("target"));

            // process list
            logger.Debug("Start migrating data...");

            CopyHandler.DatabaseCopy(sourceDatabase, targetDatabase, _sourceDatabases, _targetDatabases, _collections, _targetCollection, _insertBatchSize, _copyIndexes, _dropCollections, _skipCount, _eraseObjectId, _threads, options);

            System.Threading.Thread.Sleep(1000);

            logger.Debug("Done migrating data!");
        }