01

Issue

Windows Setup can roll back an in-place upgrade with:

0x8007001F - 0x20006
The installation failed in the SAFE_OS phase with an error during REPLICATE_OC operation.

The result portion, 0x8007001F, maps to Win32 error 31, ERROR_GEN_FAILURE: A device attached to the system is not functioning. That result is generic. The extend code is the useful boundary: phase 2 is SAFE_OS and operation 06 is REPLICATE_OC, the optional-component replication operation in the documented Windows Setup code table.

This procedure preserves and analyzes Setup/servicing evidence, repairs the existing component store when supported, and uses a verified in-place repair/upgrade path. It does not assume that the generic word device identifies a physical disk, audio adapter, or any particular driver.

Searchable Windows error codes and exact messages

Displayed identifierWindows name or exact messageWhen it can apply
0x8007001F - 0x20006The installation failed in the SAFE_OS phase with an error during REPLICATE_OC operationPrimary scope of this article. Preserve the leading zeroes and both code halves.
0x8007001F - 0x2006Commonly transcribed shortened formNormalize to 0x20006 only after the original screen/log proves the missing zero is transcription, not a different value.
0x8007001FERROR_GEN_FAILURE / A device attached to the system is not functioning.Generic Win32 result. It does not identify which component, device, package, or plug-in failed.
0x800F0805CBS_E_INVALID_PACKAGEServicing logs can use this when a package cannot be opened as valid. It supports servicing/package investigation but is not present in every 0x20006 case.
0x8007001F - 0x3000DFIRST_BOOT / MIGRATE_DATARelated result code but a different phase and operation. Use migration/user-profile log diagnosis, not this REPLICATE_OC procedure by code alone.
0x8007001F - 0x4000DOOBE/second-boot-era phase / MIGRATE_DATADifferent failure boundary. Do not merge it with 0x20006 merely because the result code matches.
0x800F081FThe source files could not be found.DISM could not locate compatible repair content. Correct the repair source before rerunning.
No numeric codeThe component store is repairable.DISM /ScanHealth found repairable corruption; continue to the supported repair branch.
No numeric codeThe component store cannot be repaired.Stop. Do not transplant registry/package branches as a general repair.
02

Applies when

Use this procedure when:

  • Windows 10 or Windows 11 still starts and the failed operation was an in-place upgrade;
  • the complete Setup code is 0x8007001F - 0x20006;
  • the screen or logs identify SAFE_OS and REPLICATE_OC;
  • the installation has enough space and no explicit eligibility/compatibility block;
  • SetupDiag or Panther/CBS logs indicate optional-component, servicing-stack, package, or component-store activity near the fatal error; and
  • important files and current Setup logs can be backed up before another attempt.
03

Does not apply when

Do not use this article for 0x8007001F without the 0x20006 extend code, for 0x3000D/0x4000D migration failures, for a clean installation, or for a Windows installation that no longer starts.

It does not apply when Setup names a specific incompatible driver/application, insufficient space, unsupported processor/TPM/Secure Boot state, Safeguard Hold, storage I/O failure, or wrong edition/language path. Resolve the named block.

Do not use it to upgrade Windows 7/8.1. This catalog's scope and preparation steps assume Windows 10/11.

04

Information that may remain unknown

The exact optional component or missing servicing registry object may remain unknown if supported component-store repair and an in-place repair upgrade restore servicing and the target upgrade succeeds.

The following may not remain unknown:

  • complete result and extend codes;
  • the final fatal Setup/servicing log entries and their timestamps;
  • installed edition, architecture, language, and build;
  • target edition/build and supported retention path;
  • DISM component-store state;
  • whether SetupDiag names a package, feature, driver, or migration plug-in; and
  • whether the chosen ISO offers Keep personal files and apps.

An exact build is required when selecting a same-version repair source or interpreting package identity. It is not needed merely to decode 0x20006.

05

Requirements

  • Verified backup of important files and, preferably, a system image
  • Stable AC power
  • Administrative access to the running Windows installation
  • Current copies of SetupDiag results, Panther/Rollback logs, CBS.log, and DISM.log
  • Microsoft ISO matching the intended edition, architecture, and base display language
  • For a same-version repair install, media at the same or newer build than the installed system
  • Enough system-volume free space for Setup and rollback
  • Recovery media and a tested way to enter WinRE
  • A written list of optional Windows features and language packs before changes

Do not begin by resetting Windows Update or deleting servicing caches. Preserve evidence first.

06

Starting position

Start in the existing Windows installation after Setup has rolled back successfully. Restart once and confirm Windows reaches a usable desktop.

Disconnect nonessential external storage and peripherals. Do not uninstall a device merely because 0x8007001F decodes to a generic device error. Do not change firmware or storage-controller mode.

Keep networking available for evidence collection and online component repair. Disconnect it only when a later controlled ISO attempt explicitly uses FIX-064's Dynamic Update-disabled branch.

07

Confirm the diagnosis

  1. Record the exact failure text. Require 0x8007001F - 0x20006, SAFE_OS, and REPLICATE_OC. If the extend code is 0x3000D or 0x4000D, stop and route by its migration phase.

  2. Record Windows identity:

    winver
    dism /online /Get-CurrentEdition
    dism /online /Get-Intl
    echo %PROCESSOR_ARCHITECTURE%
    
  3. Preserve logs in an elevated Command Prompt:

    md C:\SetupEvidence\FIX-067
    robocopy C:\$WINDOWS.~BT\Sources\Panther C:\SetupEvidence\FIX-067\Panther /E /COPY:DAT /R:1 /W:1
    robocopy C:\$WINDOWS.~BT\Sources\Rollback C:\SetupEvidence\FIX-067\Rollback /E /COPY:DAT /R:1 /W:1
    copy C:\Windows\Logs\CBS\CBS.log C:\SetupEvidence\FIX-067\CBS-before.log
    copy C:\Windows\Logs\DISM\dism.log C:\SetupEvidence\FIX-067\DISM-before.log
    
  4. Run SetupDiag and save its result under C:\SetupEvidence\FIX-067. If it identifies a specific optional component, package, language pack, driver package, or servicing-session failure, record that name exactly.

  5. Inspect the last fatal occurrence of 0x8007001F, REPLICATE_OC, OptionalComponent, CBS, DISM, abort, and abandoning in setupact.log and setuperr.log. Correlate the timestamp with CBS/DISM logs. Do not treat unrelated earlier warnings as the cause.

  6. Query component-store health:

    dism /online /Cleanup-Image /CheckHealth
    dism /online /Cleanup-Image /ScanHealth
    
  7. Inventory optional features and packages before changing them:

    dism /online /Get-Features /Format:Table > C:\SetupEvidence\FIX-067\features-before.txt
    dism /online /Get-Packages /Format:Table > C:\SetupEvidence\FIX-067\packages-before.txt
    dism /online /Get-Capabilities > C:\SetupEvidence\FIX-067\capabilities-before.txt
    
  8. Query Windows Modules Installer without changing its startup type:

    sc qc trustedinstaller
    sc query trustedinstaller
    

    A stopped demand-start service while idle is not by itself a defect. A SetupDiag/CBS failure to initialize servicing is the relevant evidence.

  9. Run protected-file verification after DISM health state is recorded:

    sfc /verifyonly
    
  10. Check the Windows volume without repair switches and confirm free space:

chkdsk C:
fsutil volume diskfree C:\

Stop on RAW media, I/O errors, or an intermittent disk.

  1. Review Turn Windows features on or off, installed language packs, and SetupDiag's named component. Do not remove anything yet. Confirm whether the named item is optional and unneeded.

  2. Confirm the Microsoft ISO matches edition, architecture, and base display language and offers Keep personal files and apps. If not, stop.

The diagnosis is bounded when the exact 0x20006 failure is present, no hard block or storage failure supersedes it, and servicing/optional-component evidence or a repairable component store supports a repair-install path.

08

Resolution steps

Branch A — DISM reports repairable component-store corruption

  1. Run the supported online repair:

    dism /online /Cleanup-Image /RestoreHealth
    
  2. If DISM returns 0x800F081F, stop. Supply a verified matching repair source under the dedicated component-store procedure; do not continue with random media or package files.

  3. After successful DISM completion, run:

    sfc /scannow
    
  4. Restart Windows.

  5. Re-run:

    dism /online /Cleanup-Image /CheckHealth
    sfc /scannow
    
  6. Continue only if DISM reports no component-store corruption and SFC reports no remaining violations.

Branch B — SetupDiag names an unneeded optional feature or language pack

  1. Confirm the exact feature/language identity in the inventory and that the user does not need it.

  2. Remove it through Settings > Time & language > Language & region, Optional features, or Turn Windows features on or off, whichever is the supported interface for that component.

  3. Restart.

  4. Run DISM /ScanHealth and sfc /scannow again.

  5. Do not remove .NET, Hyper-V, WSL, language components, or another feature merely because it appears near a warning. Removal requires a fatal-log/SetupDiag match.

Branch C — Existing servicing state is unclear or remains damaged: in-place repair install

  1. Mount verified Microsoft media from inside the running Windows installation.

  2. Run setup.exe from the mounted media.

  3. Select the same Windows edition and require Keep personal files and apps. Cancel if that option is unavailable.

  4. For a controlled repair attempt, select Not right now when asked to download updates, or follow FIX-064 if Dynamic Update itself was implicated. Do not bypass compatibility warnings.

  5. Review the final summary and select Install.

  6. Let all restarts and any automatic rollback complete without interruption.

  7. After Windows returns, run:

    dism /online /Cleanup-Image /CheckHealth
    sfc /scannow
    
  8. Confirm ordinary Windows Update scans and installs a small applicable update before retrying a feature upgrade.

Branch D — Retry the target feature upgrade

  1. Obtain fresh Microsoft media for the intended target release.

  2. Preserve the repaired baseline logs.

  3. Start setup.exe from the running Windows installation.

  4. Require Keep personal files and apps and no hard block.

  5. Complete the upgrade. If the exact 0x8007001F - 0x20006 recurs, stop after rollback and compare the last fatal log entries. Do not repeat the same repair loop.

Specialist boundary — Missing Component Based Servicing registry branches

One evidence case succeeded after restoring missing servicing registry branches from a same-build hive. That is retained as evidence but is not a general end-user step. Do not import Packages, PackageIndex, DriverOperations, Version, or other CBS branches from another computer or arbitrary image. Escalate a log-proven missing-hive case to a servicing specialist with full hive backup, exact-build provenance, and an offline recovery plan.

09

Expected results and branches

  • If component-store repair and SFC complete cleanly, servicing health is restored sufficiently to justify one controlled upgrade retry.
  • If a named optional component is removed and the retry succeeds, record the exact component; do not generalize the result to all features.
  • If an in-place repair completes and Windows Update works, create a fresh backup before the feature upgrade.
  • If 0x8007001F - 0x20006 repeats, the generic repair did not isolate the fatal component. Preserve new logs and escalate by the final SetupDiag/Setup log finding.
  • If the code changes to 0x3000D or 0x4000D, route to migration/user-profile diagnosis.
  • If DISM reports the store cannot be repaired, stop; supported recovery/reinstall planning is safer than registry transplantation.
10

Do not do this

  • Do not search only 0x8007001F and apply an audio-driver, disk, or USB fix without the extend code and logs.
  • Do not merge 0x20006 with 0x3000D or 0x4000D; they are different Setup operations.
  • Do not import servicing registry branches or package keys from another computer.
  • Do not delete WinSxS, CBS.log, pending.xml, SoftwareDistribution, Catroot2, or $WINDOWS.~BT as a first response.
  • Do not remove all optional features or language packs.
  • Do not force TrustedInstaller to an invented startup configuration because it is stopped while idle.
  • Do not use modified installation media, compatibility bypasses, or an ISO that removes the keep-apps option.
  • Do not change firmware mode, storage-controller mode, or partitions.
11

Rollback

DISM/SFC file replacements are rolled back through the pre-repair system image, not by copying individual files back.

For an optional feature or language removed in Branch B, reinstall it through the same supported Settings/Windows Features interface after the upgrade is stable. Record whether reinstating it reintroduces servicing errors.

If the in-place repair/upgrade fails, let Setup roll back automatically and preserve C:\$WINDOWS.~BT\Sources\Rollback immediately. If the repair succeeds but must be reversed and Go back is supported and available, use Windows Recovery settings while Windows.old remains intact. Otherwise restore the verified system backup.

Do not attempt to roll back a servicing registry transplant under this article because this article does not authorize one.

12

Verification

  1. Run winver and confirm the intended version/build after the final upgrade.
  2. Require dism /online /Cleanup-Image /CheckHealth to report no corruption.
  3. Require sfc /scannow to report no integrity violations, or document precisely what remains.
  4. Confirm Windows Update can scan and install applicable servicing content.
  5. Restart twice and perform one cold start.
  6. Verify user profiles, applications, optional features that remain installed, networking, audio, display, storage, activation, and Device Manager.
  7. Run SetupDiag against the final attempt and require a successful-upgrade result or absence of a new rollback failure.
  8. Preserve before/after feature/package inventories and Setup/CBS/DISM logs.
  9. Make a fresh system backup after stability is established.
13

Confidence and stop conditions

Confidence is 80% for cases with the exact 0x8007001F - 0x20006 SAFE_OS/REPLICATE_OC boundary where logs support servicing or optional-component damage and a supported component repair or keep-apps in-place repair restores servicing before the upgrade succeeds. It is not an 80% claim for bare 0x8007001F or other extend codes.

Stop when SetupDiag identifies another mechanism, storage is unstable, DISM says non-repairable, matching retain-apps media is unavailable, registry branches appear missing, the failure repeats after one clean repair cycle, rollback fails, or the installation no longer starts. No independent TechXplored reproduction has been performed for this article.