How to fix Windows upgrade error 0x80070004 - 0x2000D?
Prefer to fix it yourself? The manual steps follow.
- 7methods
- 15 minutes to 2 hours
- Intermediate
Applies to Upgrades to Windows 11 (25H2 and 26H2, and earlier versions) or to a newer Windows 10 feature update, through Windows Update, the Installation Assistant or setup.exe
7 methods in this guide
I'm trying to upgrade my Windows 10 PC to the latest version, but I keep encountering error code 0x80070004 - 0x2000D. The installation fails during the MIGRATE_DATA phase. I've checked my internet connection and disabled antivirus software, but the issue persists. Is there any solution for this?
Error 0x80070004 - 0x2000D means Windows Setup could not open a file while it moved your files and settings into the new Windows, and it rolled back. Start by finding that file in setupact.log: it is usually in a user folder that was moved, a leftover account or a folder locked by another program.
The first code, 0x80070004, is Windows error 4: "The system cannot open the file." The second, 0x2000D, says it happened while Setup migrated your data in the SAFE_OS phase. Your internet connection is not the cause. Open setupact.log and find the path next to the error (Fix 1), then put moved user folders back (Fix 2) or remove broken accounts (Fix 3) before you try again.
| Error | 0x80070004 - 0x2000D in a window titled Windows 10 Setup or Windows 11 Setup: "We couldn't install Windows", followed by the SAFE_OS and MIGRATE_DATA line. |
|---|---|
| Where it appears | After one or two restarts of a feature upgrade. Setup rolls back and shows the message when your old Windows starts again. |
| Main cause | Setup could not open a file it had to carry over: most often in a user folder moved to another drive, a broken or leftover account, or a folder another program holds open. |
| Fastest fix | Read the path next to 0x80070004 in setupact.log (Fix 1), then fix that folder or account (Fix 2 or Fix 3). |
| Also written as | 0x80070004-0x2000D, 0x80070004 0x2000D, or only 0x2000D. Error 0x80070004 alone also appears in Intune and app installs, which is a different situation. |
| Same second code | 0x8007042B - 0x2000D and 0x80070005 - 0x2000D: the same migration step, other first codes (see the FAQ). |
| Affects | Upgrades from Windows 10 22H2 to Windows 11, and between Windows 11 versions. Windows 10 left support on 14 October 2025. |
| Microsoft's status | Not a known bug. Microsoft lists the close pair 0x80070004 - 0x3000D as a data migration problem with "multiple possible causes" and says to analyze the log files. |
| Time to fix | 15 minutes for Fix 1 to Fix 3, plus one to two hours for the next upgrade attempt. |
Facts checked on 16 October 2026. Steps written for Windows 11 25H2 and 26H2 Setup run from Windows Update, the Installation Assistant and a mounted ISO, with Windows 10 22H2 and older Windows 11 versions as the starting system.
What Windows upgrade error 0x80070004 - 0x2000D means
Windows Setup reports a failed upgrade with two codes joined by a dash. Microsoft calls the first one the result code, which says what went wrong, and the second one the extend code, which says in which phase and during which operation it went wrong. This is the message the reader above saw:
We've set your PC back to the way it was right before you started installing Windows 10. 0x80070004 - 0x2000D. The installation failed in the SAFE_OS phase with an error during MIGRATE_DATA operation

| Part | How Microsoft decodes it | What it tells you |
|---|---|---|
| 0x80070004 | The 8 marks a Win32 error code. The last four digits, 0004, are error 4: ERROR_TOO_MANY_OPEN_FILES, "The system cannot open the file." | Setup tried to open a file and Windows refused or could not reach it. Despite the name, it rarely means too many files are open. |
| 0x2000D, first digit 2 | Phase 2 is SP_EXECUTION_SAFE_OS. | The PC had restarted into the small setup environment that builds the new Windows. |
| 0x2000D, last digits 0D | Operation 0D is SP_EXECUTION_OP_MIGRATE_DATA. | Setup was moving your user files, settings and apps from the old Windows to the new one. |

Setup rolls back to the Windows you had, with your files and apps in place. The error only means the upgrade did not happen. You can try again as often as you need.
Why the upgrade fails with 0x80070004 - 0x2000D
Microsoft does not publish one cause for this pair. For the close pair 0x80070004 - 0x3000D it says there are multiple possible causes and points to the logs. The ranking below follows what the code means, "cannot open the file" during data migration, and what users report. Each cause points to a fix.
| Cause | How often | How to tell | Fix |
|---|---|---|---|
| A user folder (Desktop, Documents, Downloads, Pictures) was moved to another drive, a partition or a network share, or points to a drive that is gone. | Most often, in user reports | The folder's Location tab shows a path that is not under C:\Users. | Fix 1, Fix 2 |
| An old, broken or half-deleted user account or profile folder. | Often | Accounts you no longer use, a TEMP profile, or folders in C:\Users with no matching account. | Fix 3 |
| Third-party security, backup, sync or encryption software holds files open or blocks reads. | Sometimes | The path in the log belongs to that program, or the PC has a non-Microsoft antivirus. | Fix 4 |
| Leftovers of earlier failed upgrades, or too little free space. | Less often | Earlier attempts failed, or drive C has less than 30 GB free. | Fix 5 |
| File system errors or damaged system files. | Rarely | CHKDSK or SFC reports errors, or other updates fail too. | Fix 6 |

The upgrade files were already downloaded and the PC passed the hardware check, or Setup would not have reached the SAFE_OS phase. Checking your internet connection or replacing hardware will not change this error.
How to fix Windows upgrade error 0x80070004 - 0x2000D
Fix 1 tells you which file Setup could not open, and that decides the rest. Fix 2 and Fix 3 solve the two most common causes: moved user folders and broken accounts. Fix 4 to Fix 6 remove what blocks or damages the files. Fix 7 is the fallback when nothing else works.
| What you see or have | Start with |
|---|---|
You can open setupact.log and it names a path near 0x80070004. | Fix 1, then the fix for that path |
| Desktop, Documents or another user folder lives on drive D, a network share or a removed disk. | Fix 2 |
The PC has old accounts, a temporary profile or extra folders in C:\Users. | Fix 3 |
| A non-Microsoft antivirus, backup, sync or encryption tool is installed. | Fix 4 |
| Earlier upgrade attempts failed, or drive C is nearly full. | Fix 5 |
| CHKDSK, SFC or other updates report errors. | Fix 6 |
| Everything above is done and the error comes back. | Fix 7 |
Fix 1. Find the file Setup could not open in setupact.log
10 minutesNo riskEveryone, right after the rollback. It takes 10 minutes and tells you which of the next fixes you need.
0x80070004 means one specific file could not be opened. Setup writes the path of that file into its log, so you fix that one folder or account instead of guessing.
- Press Win + R, type
C:\$WINDOWS.~BT\Sources\Pantherand press Enter. Select Continue if Windows asks for permission. - Copy
setupact.logandsetuperr.logto your Desktop, so a cleanup does not delete them. - Open the copy of
setupact.login Notepad and press Ctrl + End to go to the end. - Press Ctrl + F, type
0x80070004, choose Up and select Find next. - Read the lines just above the hit. Look for a path, for example a folder under
C:\Users, a drive letter other than C, or a network path that starts with\\. - Note the path and match it to the chooser table above: a user folder goes to Fix 2, a profile to Fix 3, a program's folder to Fix 4.
If the Panther folder is empty or gone, Microsoft's free SetupDiag tool reads the same logs for you and names the rule that failed. Download it from Microsoft, run it as administrator and open the SetupDiagResults.log it writes next to itself.
The driver error 0x80070002 - 0x20007 is solved the same way, by reading the log first: 0x80070002 - 0x20007.
It worked if: You have one path from the log, and you know whether it belongs to a user folder, an account or a program.
If not: If the log names no path, work through Fix 2 to Fix 6 in order.
Fix 2. Put moved user folders back and reconnect the drive they point to
15 minutes, longer for large foldersRead the warningDesktop, Documents, Downloads, Pictures, Music or Videos were moved to another drive, partition or network share, or the log path is on a drive other than C.
During MIGRATE_DATA, Setup follows every user folder to where it points. If that place is another partition, a network share or a disk that is no longer there, Setup cannot open it and stops with error 4.
Windows copies the files back to drive C when you restore the default. Make sure drive C has room for them, and back up the folder first: Back up your files (Windows Backup, File History, Time Machine).
- Plug in every drive your user folders point to, and connect to the network share if one is used.
- Open File Explorer, right-click Documents in the left pane and select Properties.
- Open the Location tab. If the path is not
C:\Users\<your name>\Documents, select Restore Default. - Select OK, then Yes to create the folder and Yes to move the files.
- Repeat for Desktop, Downloads, Pictures, Music and Videos.
- If OneDrive backs up these folders, it shows them under
C:\Users\<your name>\OneDrive. That is a normal location and can stay. - Restart the PC and run the upgrade again.
It worked if: Every Location tab shows a path under C:\Users, and the next upgrade passes the restarts without the rollback.
If not: After the upgrade you can move the folders back to the other drive. If it fails again, go to Fix 3.
Fix 3. Remove unused accounts and leftover user profiles, or upgrade from a new administrator account
20 minutesRead the warningThe PC has accounts nobody uses, Windows once signed you in with a temporary profile, or the log path is in another user's folder.
Setup migrates every profile on the PC, not only yours. One damaged or half-deleted profile is enough to stop MIGRATE_DATA, and removing it, or starting the upgrade from a fresh account, takes it out of the way.
Removing an account or profile deletes its Desktop, Documents and other folders. Copy anything you need from C:\Users\<that name> to another drive first: Back up your files (Windows Backup, File History, Time Machine).
- Press Win + I and open Accounts > Other users in Windows 11, or Accounts > Family & other users in Windows 10.
- Select an account you no longer use, then Remove and Delete account and data.
- Press Win + R, type
sysdm.cpland press Enter. Open the Advanced tab and select Settings under User Profiles. - Look for profiles listed as Account Unknown. Select each one and select Delete.
- Restart the PC and run the upgrade again.
If your own profile is the one in the log, create a new local administrator account, sign in to it and start the upgrade from there. Your old account stays and is migrated too, but Setup no longer runs inside it. Step by step: Create a new user account to test a problem

It worked if: Only real accounts are left, User Profiles shows no Account Unknown entry, and the upgrade passes the SAFE_OS phase.
If not: If the log path belongs to a program and not a profile, go to Fix 4.
Fix 4. Uninstall the program that holds the file open, then upgrade in a clean boot
20 minutesLow riskThe log path is inside a program's folder, or the PC runs a non-Microsoft antivirus, backup, cloud sync, disk encryption or system tuning tool.
Programs that watch or lock files can stop Setup from opening them while it migrates data. Uninstalling the program for the upgrade, and starting Windows with only Microsoft services, removes the lock.
- Press Win + I and open Apps > Installed apps in Windows 11, or Apps > Apps & features in Windows 10.
- Find the program from the log, or your non-Microsoft antivirus, and select Uninstall. Microsoft Defender takes over protection on its own.
- Restart the PC.
- Set up a clean boot so no other startup program runs, then start the upgrade.
- After Windows is upgraded, undo the clean boot and install the newest version of the program.
The clean boot, step by step: How to perform a clean boot in Windows. Do not tick Safe boot in System Configuration: the upgrade cannot run in Safe Mode.
It worked if: The upgrade runs past the second restart, and the program installs again without problems afterwards.
If not: If it fails in a clean boot too, clear the old upgrade files in Fix 5.
Fix 5. Reset Windows Update and remove the files of earlier attempts
15 minutesLow riskEarlier upgrade attempts failed, the upgrade comes through Windows Update, or drive C has less than 30 GB free.
Each failed attempt leaves its work folders on drive C. A fresh start with an empty cache means Setup does not reuse half-written files from the last rollback.
Copy setupact.log out first, as in Fix 1. Then reset the Windows Update components:
- Open Command Prompt as administrator. Type cmd in the search box, right-click Command Prompt and select Run as administrator. Select Yes when Windows asks for permission.
- Stop the update services. Type the commands below and press Enter after each one. If Windows says that other services depend on Cryptographic Services, it stops them too. A message that a service is not started is fine.
net stop wuauserv net stop bits net stop cryptsvc
The update services are stopped. Screenshot: Windows 11 26H2. - Delete the download queue files. This clears the list of downloads that the Background Intelligent Transfer Service keeps. If Windows says it cannot find the files, continue.
del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat" - Rename the update cache folders. Renaming keeps a copy in case you need it; Windows creates new, empty folders when the services start again. If you get Access is denied, a service is still running: repeat the previous step.
ren %systemroot%\SoftwareDistribution SoftwareDistribution.old ren %systemroot%\System32\catroot2 catroot2.old
Both folders now end in .old. Screenshot: Windows 11 26H2. - Start the services again. Type the commands below and press Enter after each one. The requested service has already been started is fine: Windows started it on its own.
net start cryptsvc net start bits net start wuauserv
BITS and Windows Update are running again. Screenshot: Windows 11 26H2. - Restart and check for updates. Restart the PC. Then select Start > Settings > Windows Update > Check for updates. The first check can take longer than usual because everything is downloaded again.
These steps were written for Windows 11 and Windows 10 (the steps are the same). The full page with the other versions and what each result means: Reset Windows Update components
Then free space and remove what the failed attempts left: Free up disk space and delete temporary files. In Disk Cleanup, Temporary Windows installation files holds the old $WINDOWS.~BT folder. Do not delete that folder by hand.
It worked if: Drive C has more free space, and Windows Update downloads the upgrade from the start.
If not: If the new download fails the same way, check the disk and system files in Fix 6.
Fix 6. Check the disk with CHKDSK and repair system files with SFC and DISM
30 minutes to 2 hoursLow riskCHKDSK or SFC has found errors before, the PC lost power during an earlier attempt, or other updates fail too.
A file that sits on a damaged part of the file system cannot be opened, which is exactly what error 4 says. CHKDSK repairs the file system and SFC with DISM repairs Windows' own files.
First check drive C for file system errors: Check a disk for errors (chkdsk). Then repair Windows system files:
- Open an elevated command window. Right-click Start and select Terminal (Admin), or type cmd in the search box, right-click Command Prompt and select Run as administrator. Select Yes when Windows asks for permission.

Search for cmd and choose Run as administrator. Screenshot: Windows 11 26H2. - Run DISM first. Type the command below and press Enter. DISM downloads clean copies of damaged components from Windows Update, so it can take several minutes. Wait until it says The operation completed successfully.
DISM.exe /Online /Cleanup-Image /RestoreHealth
DISM /RestoreHealth running. Screenshot: Windows 11 26H2. - Run System File Checker. In the same window, type the command below and press Enter. Do not close the window until the verification reaches 100%.
sfc /scannow
sfc /scannow at 100%. Screenshot: Windows 11 26H2. - Read the result and restart. Compare the last message with the table below this guide, then restart the PC so that repaired files are loaded.

The result line tells you what SFC did. Screenshot: Windows 11 26H2.
These steps were written for Windows 11 24H2 and 25H2. The full page with the other versions and what each result means: Run DISM and SFC to repair Windows system files
It worked if: CHKDSK reports no remaining problems, and SFC says it found no integrity violations or repaired them.
If not: If CHKDSK finds bad sectors, back up your files before anything else and read the hardware note below. Otherwise go to Fix 7.
Fix 7. Upgrade from the ISO and keep personal files only
1 to 2 hoursRead the warningFix 1 to Fix 6 did not help, and you accept installing your apps again after the upgrade.
With Keep personal files only, Setup carries over your files but not your apps and their settings. That is much less data to migrate, so a broken app folder or setting no longer stops MIGRATE_DATA.
This option keeps your files but removes installed apps and their settings. Note your apps and licence keys, and back up your files first: Back up your files (Windows Backup, File History, Time Machine).
- On Microsoft's Download Windows 11 page, download the ISO under Download Windows 11 Disk Image (ISO) for x64 devices.
- Right-click the ISO and select Mount, then open the new drive and double-click
setup.exe. - When Setup asks what to keep, select Change what to keep.
- Select Keep personal files only, then Next and Install.
- After the upgrade, install your apps again from their makers.
More on the keep options and what each one removes: Reinstall Windows without losing files
It worked if: Setup finishes, and you sign in to the new Windows with your files in your user folders.
If not: If even this fails with the same code, read the still broken section below.
If error 0x80070004 - 0x2000D is still there
When every fix fails, the answer is still in the logs. Each attempt writes a new setupact.log, so copy it out right after the rollback and compare the path with the one from the last attempt.
| What you find | What to do |
|---|---|
| A new path after you fixed the first one | Repeat the fix for that path. Some PCs have several moved folders or broken profiles. |
| The same path every time | Copy the files out of that folder, delete the folder, and try again. |
| No path at all | Run Microsoft's SetupDiag tool and read SetupDiagResults.log. |
| A work or school PC | Ask the IT department. Folder redirection and roaming profiles are set by their policies. |
| CHKDSK finds bad sectors, or the PC freezes during the upgrade | Back up first. That is a sign of a failing drive, not of this error. |
- What to send to support: the full code, your current Windows version and build, how you started the upgrade, and the PC model.
- Attach
setupact.logandsetuperr.logfromC:\$WINDOWS.~BT\Sources\Panther, or the SetupDiag result. - Say which folders or accounts you changed and what happened after that.
Error 4 is a file access problem, not a hardware fault. If the code changes from one attempt to the next, or CHKDSK reports bad sectors, check the drive's health before another upgrade attempt.
How to keep 0x80070004 - 0x2000D from coming back
- Keep user folders on drive C during a big upgrade, or keep the drive they point to plugged in.
- Remove accounts you no longer use, with their data backed up.
- Keep 30 GB or more free on drive C before you start.
- Copy
setupact.logout after any failed upgrade before you try again.
- Do not point user folders at a network share or a removable drive.
- Do not delete folders in
C:\Usersby hand. Use Settings or User Profiles. - Do not delete
$WINDOWS.~BTby hand. Use Disk Cleanup. - Do not stay on Windows 10: it left support on 14 October 2025.
Frequently asked questions
What does 0x80070004 - 0x2000D mean?
It means Windows Setup could not open a file while it moved your data into the new Windows. Microsoft's guide to upgrade error codes splits the code in two. The result code 0x80070004 is Win32 error 4, ERROR_TOO_MANY_OPEN_FILES, with the text "The system cannot open the file." The extend code 0x2000D is phase 2, SP_EXECUTION_SAFE_OS, with operation 0D, SP_EXECUTION_OP_MIGRATE_DATA. Setup then rolls back to your old Windows. The file is named in setupact.log.
What is 0x8007042B - 0x2000D?
It fails at the same step, data migration in the SAFE_OS phase, but with another first code. 0x8007042B is Win32 error 1067, ERROR_PROCESS_ABORTED: "The process terminated unexpectedly." A process Setup needed for the migration stopped, instead of a file failing to open. Users report it with security software, system tuning tools and modified Windows images. Read setupact.log the same way as in Fix 1, then try Fix 4 and Fix 7 first. The search spellings 0x8007042B-0x2000D and 0x8007042B 0x2000D are the same error.
Does 0x8007042B - 0x2000D happen on Windows 11 too?
Yes. The code pair is the same on Windows 10 and Windows 11, because both use the same Setup engine with the same phases and operations. Users report it during upgrades to Windows 11 versions such as 23H2, 24H2 and 25H2, as well as during older Windows 10 feature updates. The window title then reads Windows 11 Setup. The fixes on this page apply unchanged, and the log is in the same Panther folder.
What is 0x80070005 - 0x2000D?
The first code, 0x80070005, is Win32 error 5, ERROR_ACCESS_DENIED: "Access is denied." With 0x2000D it means Setup found the file but was not allowed to read it while migrating data. Microsoft lists the close pair 0x80070005 - 0x4000D as access denied during data migration and says to find the denied item in the logs. Start with Fix 1, then Fix 4 for security software and Fix 3 for profiles with broken permissions.
What does 0x2000D mean on its own?
0x2000D is only the extend code, the when of the error. The first digit, 2, is the SAFE_OS phase, when the PC runs a small setup environment after the first restart. The last two digits, 0D, are the MIGRATE_DATA operation, when Setup moves user files, settings and apps. It tells you where the upgrade stopped, not why. The why is in the first code, such as 0x80070004, 0x8007042B or 0x80070005. Searches for 0x2000 usually mean the same code with the last letter cut off.
Is 0x80070004 always an upgrade error?
No. 0x80070004 alone is a general Windows error, "The system cannot open the file", and also shows up in Intune app installs and other installers. This page covers it as part of a Windows upgrade, together with 0x2000D. If you see 0x80070004 in Intune or the Company Portal, the cause is in that app's install command or files, and the fixes here do not apply.
Do I lose my files when the upgrade rolls back?
No. The rollback returns the PC to the Windows you had before, with your files, apps and settings. Windows says so in the message: "We've set your PC back to the way it was right before you started installing." Only the time is lost. Your files are at risk only in the fixes that say so: deleting accounts in Fix 3, moving folders in Fix 2, and Fix 7, which removes apps. Back up before those.
Does turning off the antivirus fix it?
Usually not, and the reader above already tried it. Turning off a third-party antivirus often leaves its drivers and file filters running. If security software is the cause, uninstall it for the upgrade and reinstall it afterwards, as in Fix 4. Microsoft Defender does not need to be turned off. Pause it for one attempt only if you have no other lead, and turn it back on right after: Turn off Microsoft Defender protection for a moment.
Will the Windows Update troubleshooter fix 0x80070004 - 0x2000D?
Rarely. The troubleshooter repairs the download and install service of Windows Update. This error happens later, after the download, inside the setup environment that migrates your data, which the troubleshooter does not reach. It does no harm to run it, but if the upgrade came through Windows Update, resetting the components in Fix 5 is the stronger version of the same idea. For this code, the log in Fix 1 helps more.
What does site:ugetfix.com show for this error?
That search lists the pages on this site. For upgrade errors in the same family, such as 0x80070002 - 0x20007 or 0xC1900101, uGetFix has separate guides, each built around its own code pair. This page covers 0x80070004 - 0x2000D and its close relatives 0x8007042B - 0x2000D and 0x80070005 - 0x2000D, which fail at the same migration step of a Windows upgrade.
Sources
- Microsoft Learn: Windows upgrade error codes (result codes, extend code phases and operations) (learn.microsoft.com)
- Microsoft Learn: Windows upgrade resolution procedures (0x80070004 - 0x3000D, 0x80070005 - 0x4000D, 0x80070004 - 0x50012) (learn.microsoft.com)
- Microsoft Open Specifications [MS-ERREF]: Win32 error codes (errors 4, 5 and 1067) (learn.microsoft.com)
Did this fix work?
One click, no account. It tells the next reader which guides are worth their time.
Questions and experiences: fix Windows upgrade error 0x80070004 - 0x2000D
Still broken, or found a fix we did not cover? Ask here: members and our editors answer. Reading is open; writing needs a free account.
…