Backup and Restore Boot Camp on a new mac for free

If you want to move your Windows 10 Boot Camp partition from one Mac to another, or simply to make a backup, then I hope this guide will help you! Please start by taking backups of all your data – both Mac and your Windows installation – and store these backups some place safe while you work. We will use open source and other utilities already installed on your mac – dd, hdiutil, and Disk Utility.

I do not wish to be held responsible for any loss and, while this procedure worked for me, I never claim to be an expert at anything unless I am getting paid. I tested this process on macOS Sierra 10.12.3. First, open up Disk Utility in your original Mac with a  Boot Camp partition. You will need enough space to backup all the files so double check you have enough disk space in the location you plan to save this backup. The size of your backup will be identical to the partition capacity (not used) – so plan ahead! You will want to take an image of your BOOTCAMP partition. Right click on the partition and select “Image From …” and save this file to anywhere on your mac. The default save options are fine. This process may take a few minutes. Copy this file over to the new machine.

bootcamp backup partition

Here is the trick – pay attention! The dmg backup file that you generated cannot be directly restored by Disk Utility on the new machine. If you naively try to restore this file, Disk Utility will fail and show the following error about an “Could not restore – Invalid Argument.” I tried many free demos of NTFS utilities to try to format a drive, etc – none of the free solutions worked.

fail restore boot camp
Could not restore – invalid argument

However, in Mac thanks to its linux support there is a very powerful (read: extremely dangerous) utility called “dd” which copies data byte by byte rather than how most copy operations work “file by file.” Our backup is in a “file by file” format. We need to convert the dmg backup you took into a “byte by byte” format that the “dd” utility can use.

We will use hdiutil to convert your dmg image. Open up “Terminal” and run the following command (type in your login password when it asks):

hdiutil convert -format UDTO -o BOOTCAMP.img BOOTCAMP.dmg

hdiutil convert boot camp
hdiutil convert boot camp

You will need to prepare your new Mac for Boot Camp The easiest and safest way I could find was to install a new copy of Windows 10 and then effectively overwrite your backup on top of it. I did not test other ways.

To do this process you will need to run Boot Camp on your new mac and reinstall Windows 10. You do not even need a valid product key. Do not spend any time setting it up because we are just going to overwrite it once we are complete. You can download the Windows 10 image for free from here: https://www.microsoft.com/en-us/software-download/windows10

Now that you have a fully functional blank Boot Camp install, boot your new MacOS up and open up your Disk Utility. Right click on your  Boot Camp partition and select “Get Info”. We need to see the disk name. Be very careful to ensure you are 100% positive you have the correct disk, or else you may lose all your data on a different device. Here is a screenshot of my BOOTCAMP disk. We need to look for the “disk0s4” which means BOOTCAMP is on /dev/rdisk0s4. Notice the “r” in front of that disk – it’s not in this picture.

Open up “Terminal” on your new mac. We are ready to restore your converted backup image using “dd” by overwriting your new Boot Camp partition with your backup disk.img.cdr file that you generated. Again, be very, very careful that you have correctly entered the correct disk — this command can easily wipe out data! Again, note how the disk device has a “r” in front of it.

sudo dd bs=1m if=BOOTCAMP.img of=/dev/rdisk0s4

dd disk restore
dd disk restore

This may take a few minutes to complete and it is silent while it performs its magic. Once it does so successfully you are done! You may restart your new computer, press the “Option + R” keys while booting, select your Windows Boot Camp partition, and you should see your restored installation working.

Comments are appreciated. If I made any mistakes or you still have questions, please let me know. If this guide works for you please pay it forward.

38 thoughts on “Backup and Restore Boot Camp on a new mac for free”

  1. Hi Benjaman,

    Thanks for the article. I found it coherent enough for me to try, but it did not work for me.

    I saved my .dmg to an external drive formatted Mac OS Extended (journaled) with GUID partition. Through Terminal I did the conversion to .img.cdr format (it took 3 hours and 31 minutes with a USB 3 HDD). I used your Terminal commands and all went well.

    For the “swap” to BootCamp I had to change up your commands a bit:
    sudo dd bs=1m if=”/Volumes/Swap/BOOTCAMP.img.cdr” of=”/dev/rdisk0s4″

    The “0” in “rdisk0s4” is of course a zero (not a capital letter O), and “Swap” is the external drive name.

    The command ran for about 2 hours and did end up in error. The BootCamp partition does boot, but does not have a startup screen–just a blinking cursor.

    Here is a list of information on the donor Mac and the test Mac:

    Donor:
    2012 MacMini
    Mountain Lion OS
    525 GB SSD
    450 GB dedicated to BootCamp (Win7Prox64)

    Test Subject:
    2014 MacBook Pro
    Maverick OS
    500 GB SSD
    430 GB dedicated to BootCamp (Win7Prox64, separate license)

    The BootCamp program was enabled for both BootCamp systems; in other words, after installation of Windows with BootCamp Assistant the BootCamp .exe file was run to install BootCamp controls. I do not know if this fact or the use of different OS versions contributed to failure.

    My best guess (and just to confirm–I do not have a programming or computer science background) is failure due to the donor file being larger than the test partion size.

    Any thoughts?

    Can you recommend your personal favorite BootCamp restore software? At this point I am willing to purchase an imaging program rather than go through the BootCamp reinstall hassle. I just wish I knew which one to trust and not fail me when needed. The 144 important updates during initial Windows install is not so bad anymore, but reinstallation of Adobe Suite, AutoCAD, and having to call and sweet talk MathWorks and Rosetta Stone every time is very time consuming.

    Once again, thanks for your article and the time you put into it. I will save .dmg images of BootCamp, and I am confident that one day I will be presented with the opportunity of misfortune to try your procedure again.

    Sincerely,
    Kelly

    1. It likely was the difference in partition sizes. I would strongly recommend keeping the sizes exactly the same, or ensuring the original partition is smaller than the new partition size. I doubt it was the difference in Windows versions but it is possible (the boot parameters might be stored outside the backup – I don’t know)

  2. I am not sure you meant Option + R

    If you hold down the Option key right after turning on the Mac,
    then you will get icons of each of the bootable partition(s).

    I also got the file not found error and chose to use the
    entire path instead.

    sudo dd bs=1m if=/Users/me/Desktop/BOOTCAMP.img.cdr of=/dev/rdisk0s4

  3. When making the initial disk image did you format it as read only?? (there is also read/write and compressed)

  4. Does this still work for a boot camp transfer from an old MacBook Pro 2011 running boot camp from 2015 with Windows 10 to a new MacBook Pro 2018?

  5. I cannot seem to view the Windows Boot Camp partition after pressing “Option + R.” I only see the Mac drive. Everything else worked correctly, but I just can’t select that drive in startup disk. However, in disk utility it shows up.

    Suggestions?

  6. I followed the guide and it does restore the file system in the target BOOTCAMP partition but it doesn’t boot.
    When I select the boot option it gets stuck to a black screen with blinking cursor.

    I tried few other things but I couldn’t get it to boot.

  7. Wow how did I miss that? Thanks,
    But before I retry this, will it work if I’ve saved the file on an external hard drive? There wasn’t enough space on my Mac.

  8. So the terminal code will find the file on the ext. hard drive so long as the file name matches, will convert the file, and will replace the original file directly to the ext hard drive as well?

  9. I have the image file on an external HD and DD can’t seem to find it.

    dd: ”BOOTCAMP.img.cdr”: No such file or directory
    MacBook-Pro:Bootcamp image sabsfeigler$ sudo dd bs=1m if=”BOOTCAMP.img” of=/dev/rdisk0s4
    dd: ”BOOTCAMP.img”: No such file or directory
    MacBook-Pro:Bootcamp image sabsfeigler$

    I’ve tried with cdr and without cdr and it can’t find it either way. Do I need to somehow remove the cdr from the image file name on my drive?

  10. I followed your process with only a few minor bumps along the way. Up until I tried to reboot – no startup manager showed up. iMac was not happy – said something was wrong (It was a very general message). And then appeared to go thru some recovery steps. Once OS recovered and booted into macOS, BOOTCAMP partition was not available (greyed out in DiskUtil and not mountable). I’m running Mojave on a 2019 iMac. My source was a 95g GB Win10 on a 2010 iMac. Note the current bootcamp asst would not let me create a 95GB destination – 108 GB was the minimum size. this is Just FYI. I am probably not going to retry this. thanks

  11. After executing the last step (restore from image) the Bootcamp Partition doesn’t boot. It stands at a black screen with one underline-symbol blinking at the top left corner.
    I don’t have a recovery partition, so I can’t execute the very last step.
    Booting from an external osx-installing-USBdrive to set the permission-reset from disk utility also doesn’t help.
    I’m very thankful for any advice…

  12. Thank you so much for this guide. Just recently setup a dual boot on my MacOS running Catalina & Windows 10. Prior research led me to waste so much time trying to get winclone working. After hours of messing with it, finally gave up and kept research for something better which led me to here.

    I pretty much followed all the steps. Only road bump I came across on was that after the restore and reboot, the Windows partition gave me a boot error. So decided to boot from the USB drive that was created during the boot camp partition, ran startup repair, and voila! Dual boot is back in working order. Thank you so much again.

  13. I tried using the guide and followed the instructions very carefully – twice. Each time I did it I got the same end result when booting to the Windows partition – a blinking cursor. Fortunately, BootCamp allows you to delete the partition so you can start over. The second time I did it, I went to my Mac’s Disk Utility to look at the Windows partition. Disk Utility reported that the partition was using 118GB of space out of the 200GB I allotted it via BootCamp. I know this is wrong – my previous Mac’s Windows partition was 120GB in total and only a part of that (50-60GB) was used. It looks like the process does not correctly load the cloned partition onto the new partition.

    Fortunately, I had not used my Windows set-up too much before needing to switch computers so I will simply do a clean-install with BootCamp and re-install my apps. I was hoping this process would work for me, but it looks like I am back to the drawing board.

  14. Hi Ben,

    I just wanted to thank you and let you know that this method WORKS, but needs a few extra steps in my case. I am sharing my experience in case someone is having trouble as I did.

    I have a 2014 15-in Macbook Pro Retina that I just upgraded with the faster Samsung EVO 970 SSD. Naturally I wanted to back both my partition up and restore them after the SSD install. My Mac side is backed up and restored using Time Machine. My Windows (bootcamp) was backed up using your method. Everything worked fine up until I tried to boot into Windows. I was getting a boot loop error (windows logo with spinning balls, restart, repeat).

    I tried to do a recovery by hitting F8 before the Win Logo and it didn’t work, 0x000000f error. I then booted using my Bootcamp-Assistant-made Windows install thumbdrive, only to realize it is missing the Repair Windows Installation menu. So I had to pull up my spare old Windows 7 laptop and created a regular Windows 10 bootable thumbdrive. Once that’s done I was able to boot up into the repair portion of the bootable drive. I tried automatic repair, didn’t work, was getting a 0x32 error (A BSOD error typically related to windows updates). I opened command prompt on the bootable drive to see if my files were restored correctly, and they were. I then tried manually reparing with varius chkds, bcdrepair, and so on at command prompt and none of them was doing anything. Then I saw that someone has had a success with the DISM tool for windows update 0x32 errors. I tried that and my Windows Bootcamp booted right up, exactly as I left it.

    So here are steps to add to your tutorial/guide (if you wish):
    A. If you only have one computer, you’ll need 2 thumbdrives, one for the bootcamp install, one for Windows recovery (windows tool). If you have a spare laptop, you can create the bootcamp one first, then the Microsoft one on the same drive after like I did.
    B. The last steps to complete the restoration (after the dd restore) are:
    1. Plug in Windows Bootable Drive (made using the official Microsoft Windows tool, not Mac Bootcamp Assistant)
    2. Start computer while holding option key and select bootable drive
    3. Hit next on the very first screen (language and keyboard layout options)
    4. On this next window, instead of install, hit Repair Windows Installation at the bottom left corner.
    5. I forgot exactly which menu is available next, but the goal is to get to Command Prompt (I think select advanced troubleshooting, then command prompt)
    6. Once in command prompt you may want to verify your data by going to C: drive (Type: C:) and check your files in C:\Users\your-username\ folder. If they are present that’s good news, dd restoration was successful. Also you may need to use the command: bcedit|find “osdevice” to figure out which drive letter assignment your Windows is on.
    7: Go back to the X: drive by typing: X:
    8: Type: “dism /image:C:\ /cleanup-image /revertpendingactions”

    And that should do it! Windows should boot right up.

    Thought I share that with you. Hope it helps anyone trying to do what I did. Thanks again!

  15. It’s work for me perfectly after i try many times to restore image to bootcamp partition.
    If you cannot boot on windows, you can clear PRAM (options+commands+P+R and turn on your mac after chim sound release it).

  16. Why not just use “dd” to create your original block image of the partition? If that works you won’t need to convert the format at all… dd bs=1m of=”/Volumes/Swap/BOOTCAMP.img.cdr” if=”/dev/rdisk0s4″ .. and then: dd bs=1m if=”/Volumes/Swap/BOOTCAMP.img.cdr” of=”/dev/rdisk0s4″

  17. I did everything as I was supposed to but after recovering the Windows image by dd I got bsod and „Inaccessible boot device” 🙁

  18. I follow the guidelines easily up until –

    “We will use hdiutil to convert your dmg image. Open up “Terminal” and run the following command (type in your login password when it asks):

    hdiutil convert -format UDTO -o BOOTCAMP.img BOOTCAMP.dmg”

    I have copied the .dmg bootcamp file to the new MacBook and when I tun the terminal script, it just says “hdiutil: convert failed – No such file or directory”

    What am I doing wrong? Do I need to copy the file to the new MacBook in a certain folder? I’ve tried running the script on the old computer and it still fails…

  19. Welcome to 2021!
    With SSD and USB 3.0, this is great!
    Thanks for the “rdisk” option, that really speeds things up.

    1. I split an external SSD into APFS and FAT32 partitions.
    2. On the APFS partition I did the Disk Utilities recover to BOOTCAMP.dmg
    3. Using hdiutil I converted to BOOTCAMP.img.cdr.
    4. I booted into my Bootcamp Windows and reformatted the SSD FAT32 partition into NTFS.
    5. Reboot to MacOS. I had to change the last command to
    sudo dd bs=1m if=BOOTCAMP.img.cdr of=/dev/rdisk#s# (insert the correct numbers for the #)
    (Without the .cdr extension the command failed.)
    I now have an bootable Windows partition on an external SSD!
    I use Windows so seldom that keeping it on an external drive is convenient, and leaves the Mac’s internal drive for all my regular stuff.
    I also use the rEFInd boot loader to help me select boot partitions when I start up.

  20. Thank you so much. You saved my backup. I made the mistake of making a backup using Disk Utility and not realizing that I couldn’t then restore the dmg file. Parallels Desktop 17 then somehow corrupted my Boot camp so I couldn’t boot into it. Don’t get me started on Parallels, their support was not helpful, and too slow to respond. I then tried all manner of options which failed. Yours worked! Ok, it was a bit of trial and error and I had to put quotation marks but it worked. I was worried at first because after executing the SUDO command it asked for my password then the cursor just sat there with no output from Terminal. I left it for a while then terminated Terminal. But it had done its magic.

  21. worked fine as the instructions describe, big sur, last intel macbookpro of its kind.

    i wanted to use this to resize the bootcamp partition, which didn’t work as well. the default drive of the restored image still listed itself as the old partition size, even thought disk management (in windows) had the correct, resized partition. probably a way to fix it, but wasn’t worth it given how little was on my windows partition.

  22. When using the dd command I get the following in Terminal suggesting it did something but when looking at the drive the used space hasn’t changed and there are no visible files on the drive.

    76258+0 records in
    76258+0 records out
    79962308608 bytes transferred in 89.259143 secs (895844458 bytes/sec)

  23. The procedure described is incomplete. It may work if you only want to use a new SSD on the same MAC.
    But if you wish to take a BOOTCAMP partition from an older MACbook (say pre 2015) to a newer one
    (say 2019) you will run into difficulties because the old BOOTCAMP Windows will likely be missing some drivers.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.