/// <summary>
        /// Migrates the current IDTable data to the new IDTable ID scheme.
        /// </summary>
        /// <remarks>
        /// Runs through all the uCommerce entries in the IDTable.
        /// Each entry is examined to determine what action to perform.
        ///
        /// If the entry corresponds to a uCommerce entity, that entity's Guid is updated.
        /// If the corresponging entry cannot be updated, then instead we:
        ///  1. Migrate the standard values to the new ID.
        ///  2. Delte the IDTable entry to get it to be recreated with the new ID.
        /// </remarks>
        public void Run(ITaskOutput output, NameValueCollection metaData)
        {
            if (DataIsAlreadyMigrated())
            {
                return;
            }

            var watch = new Stopwatch();

            watch.Start();

            var entries = GetAllUCommerceIdTableEntries();

            foreach (var entry in entries)
            {
                // This also populates the dictionaries with the data used by the Migrate...() methods called below.
                PrepareMigrationOfEntry(entry);
            }

            MigrateVariantTemplateIds();
            MigrateStandardValueItemIds();

            DeleteEntriesToBeRegeneratedWithNewId();

            _log.Log <MigrateIdTableValues>("Combined sql statement for migration of IDTable data: " + CombineStatementsToSingleStatement());
            RunAllSqlStatementsAgainstDatabase();

            MarkDataAsMigrated();

            watch.Stop();
            _log.Log <MigrateIdTableValues>(string.Format("Migration of IDTable entries took {0} ms", watch.ElapsedMilliseconds));
        }
Exemplo n.º 2
0
        public void Run(ITaskOutput output, NameValueCollection metaData)
        {
            string _virtualPathToAppsFolder = "~/sitecore modules/shell/ucommerce/apps";

            if (_sitecoreVersionChecker.IsEqualOrGreaterThan(new Version(9, 2)))
            {
                new DirectoryMover(
                    new DirectoryInfo(
                        HostingEnvironment.MapPath($"{_virtualPathToAppsFolder}/Sitecore92compatibility.disabled")),
                    new DirectoryInfo(
                        HostingEnvironment.MapPath($"{_virtualPathToAppsFolder}/Sitecore92compatibility")),
                    true).Move(ex => _sitecoreInstallerLoggingService.Log <Exception>(ex));
            }


            if (_sitecoreVersionChecker.IsEqualOrGreaterThan(new Version(9, 3)))
            {
                new DirectoryMover(
                    new DirectoryInfo(
                        HostingEnvironment.MapPath($"{_virtualPathToAppsFolder}/Sitecore93compatibility.disabled")),
                    new DirectoryInfo(
                        HostingEnvironment.MapPath($"{_virtualPathToAppsFolder}/Sitecore93compatibility")),
                    true).Move(ex => _sitecoreInstallerLoggingService.Log <Exception>(ex));
            }
        }
Exemplo n.º 3
0
        public void Run(ITaskOutput output, NameValueCollection metaData)
        {
            var assemblyVersion = _runtimeVersion.GetUCommerceRuntimeAssemblyVersion().ToString();

            _installerLoggingService.Log <UpdateUCommerceAssemblyVersionInDatabase>("New uCommerce version: " + assemblyVersion);
            _updateService.UpdateAssemblyVersion(assemblyVersion);
        }