# How To GuideMethod to upgrade every month, without wiping data and retaining root

##### Senior Member
So if I am trying to flash this. Am I only to use the extracted folder? Also extracting the boot.img Am I removing it entirely from the extracted folder? or do I leave the stock boot.img in the extracted folder? Then flash all.. Then I proceed to flash the patched magisk boot right?
You extract the contents of the factory image zip file into a folder. The extracted folder will have 6 items (see 1st screenshot below). You place these items in your Platform Tools folder and then run flash-all.

In regards to patching the boot image, the boot image is extracted from the zip file shown in the 2nd screenshot below. You then patch that in Magisk, go into the bootloader and flash that patched image.

And of course follow the instructions in the OP about modifying the flash-all.bat file.

And if this is the first time you are disabling those 2 flags in vbmeta you will have to factory reset after disabling those flags and proceed to follow the instructions in the OP. A search will reveal several threads explaining this if you are unfamiliar with it.

#### Attachments

• Screenshot 2021-11-24 130512.png
23.1 KB · Views: 79
• Screenshot 2021-11-24 130825.png
29.1 KB · Views: 79
galaxys

#### dabrownie

##### Member
So I notice there are some people, like me, that are a bit confused on how to exactly do this process. I like to be nice every once in a while, so this is my time. I will try to do a step by step process with exactly how I did after reading, and re-reading all the comments on how to do it (with pictures cuz I need pictures to learn haha).

These are the exact steps I took when I updated from .36 to .37

Slapped the .37 zip file into a folder by itself so I can extract it inside that same folder. It should look like this once its extracted inside the same folder.

Then I opened another folder/window with the Platform-tools so I can easily navigate between the 2 folders.

Then I opened the flash-all.bat from the zipped folder, to see what it contains, noticed that it flashes 3 files/images.
“Image-raven-sd1a”

Then close the file as we dont need it right now.

So with this I know that I will need to add those 3 files to the platform-tools folder when I go to actually run the command.

I actually took the .37 boot.img and copied it into my pixel with version .36 still running.
The boot.img is inside the zipped folder and when you extracted it, it will now be viewable along with other files and the zipped folder still there.

copy this boot into the main folder of the pixel

On your Pixel, open Magisk and click install then select patch file, navigate to the boot.img file in your internal storage.
Patch it with Magisk and then take the patched boot.img (which that file will actually be in your downloads folder in your Pixel) and copied it back to my computer.

So as of now, it seems we are able to patch boot.img with current build without having to update then patch then flash. We can just patch on the current build then copy the patch to the computer and run the rest of the steps.

Now that I have the patched boot.img on my computer, I will take all the highlighted files in the picture, plus the patched boot.img over to the Platforms-tools folder and just copy them in that folder.
Here, I’m not sure how everyone else has their folder since I rarely use those tools, so I just add the files and then delete them after I’m done flashing. See picture of all copied in files. (dont forget your patched boot.img)

Now I will open the flash-all.bat that's inside the Platform-tools using Notepad ++ (personal preference).
Edit this file exactly like in the picture. Add the lines exactly how it shows in the picture.
**NOTE** that you need to type the exact patched boot file in there. So, like in this picture, but with YOUR patched "magisk_patched" file as this will have your own ID after 23014.

once you made the edits on this file, dont forget to save it before you run the commands!

Now plug in your phone to the computer.
Make sure you have USB debugging turned on.
Press shift and right click inside the Platform-tools folder and open Command Prompt.
run these 2 commands:
flash-all.bat

When it's all done, your phone will boot up and you will be on the new .37
Nothing else to add here as it will literally run through everything for you and boot up and you're done.

Hope this helps someone, as I am a visual learner myself.

#### Attachments

• 1637794693830.png
121.3 KB · Views: 77
• 1637794820716.png
121.3 KB · Views: 65
Last edited:

#### stalls

##### Senior Member
I finally got it. I was just not being patient enough while flashing in fast boot. I'm just an idiot and didn't wait long enough for it to finish its process. Other than my own fault. It worked flawlessly. Thank you!

roirraW "edor" ehT

#### A.Priori

##### Senior Member
I've done this but are there any settings to turn off automatic updates and install so we can do it manually?

#### malybru

##### Senior Moderator
Staff member
I've done this but are there any settings to turn off automatic updates and install so we can do it manually?
Is this what you are talking about:

Settings>System>Developer Options

See attachment

#### Attachments

• Inked2021-11-28_LI.jpg
1.2 MB · Views: 49

#### Kuredant

##### New member
I tried running these instructions to upgrade from a rooted 12.0.0 (SD1A.210817.036, Nov 2021) to 12.0.0 (SD1A.210817.037, Nov 2021), with Magisk 23015.
Everything went fine but the build number in "About phone" is still SD1A.201817.036, and an OTA update is still available in "System update".
Is there something I'm missing? I retried several times and I'm sure I'm using the SD1A.210817.037 image.

#### js042507

##### Senior Member
I tried running these instructions to upgrade from a rooted 12.0.0 (SD1A.210817.036, Nov 2021) to 12.0.0 (SD1A.210817.037, Nov 2021), with Magisk 23015.
Everything went fine but the build number in "About phone" is still SD1A.201817.036, and an OTA update is still available in "System update".
Is there something I'm missing? I retried several times and I'm sure I'm using the SD1A.210817.037 image.
You sure the OTA sideload went through properly? It should take about 5-10 min or so. FYI, I went through an OTA and maintained root just fine to .37. My method is using the OTA update though, not the factory image. In my opinion, it's easier to use OTA. The entire process is very simple.

Download both OTA and factory image. Copy (you don't have to extract, use 7zip) the boot.img and vbmeta.img from factory image zip.

Take the new boot.img, copy to phone, and patch with magisk. Copy patched .img over to PC.

Reboot to recovery. Hit vol+ and power button to display recovery menu options.

Wait several minutes.

Once complete, choose "boot into bootloader" from recovery menu. You should now be in fastboot mode.

fastboot flash vbmeta --disable-verity --disable-verification --slot-all "path\to\vbmeta.img" (from factory image .zip)

fastboot flash boot --slot-all "path\to\patched.img"

And done! It should really be that simple.

#### Kuredant

##### New member
You sure the OTA sideload went through properly? It should take about 5-10 min or so. FYI, I went through an OTA and maintained root just fine to .37. My method is using the OTA update though, not the factory image. In my opinion, it's easier to use OTA. The entire process is very simple.

Download both OTA and factory image. Copy (you don't have to extract, use 7zip) the boot.img and vbmeta.img from factory image zip.

Take the new boot.img, copy to phone, and patch with magisk. Copy patched .img over to PC.

Reboot to recovery. Hit vol+ and power button to display recovery menu options.

Wait several minutes.

Once complete, choose "boot into bootloader" from recovery menu. You should now be in fastboot mode.

fastboot flash vbmeta --disable-verity --disable-verification --slot-all "path\to\vbmeta.img" (from factory image .zip)

fastboot flash boot --slot-all "path\to\patched.img"

And done! It should really be that simple.
Thanks, this worked like a charm!

roirraW "edor" ehT

#### DarkusRattus

##### Member
So I tried upgrading to SD1A.210817.037 without the disable-verity and disable-verification tags, and now even after reflashing with the tags, I cannot boot with the magisk_patched.img or the normal boot.img. The only way to boot is by reflashing without the disable-verity and disable-verification tags.

Do I have to do a factory reset in order to boot with Magisk again?

##### Senior Member
So I tried upgrading to SD1A.210817.037 without the disable-verity and disable-verification tags, and now even after reflashing with the tags, I cannot boot with the magisk_patched.img or the normal boot.img. The only way to boot is by reflashing without the disable-verity and disable-verification tags.

Do I have to do a factory reset in order to boot with Magisk again?
After the first time flashing with those 2 flags disabled, you do need to factory reset. After that you will not have to factory reset again unless you reflash the stock vbmeta image without the 2 flags disabled, which is what it sounds like you did. So yes, you will have to factory reset.

If you want to avoid having to do a factory reset in the future, always upgrade with those 2 flags disabled.

#### torsti

##### Senior Member
Actualy I cant open magisk to Patch Bootimage. Magisk crash after a few seconds

#### torsti

##### Senior Member
3 Times yes.

But I hided magisk, so i cant install "the same" Version as "Update"

#### roirraW "edor" ehT

##### Forum Moderator
Staff member
3 Times yes.

But I hided magisk, so i cant install "the same" Version as "Update"
If you're still rooted on your old version, do a backup of your apps, or if you're not worried about it, skip that step. Uninstall Magisk, install Magisk Canary 23015, try again. If it still crashes, I'm not sure what to suggest other than a reboot and try again. Move your app backup, if you performed any, off the phone and do a factory reset. Do a full factory image flash of the latest build, then go through the process from start to finish again.

Edit: When I had Magisk hid on build 23014, I was able to update the app to 23015 (it stayed hidden), then Direct Install without manually patching and flashing the boot.img.

#### torsti

##### Senior Member
Got it. After uninstall and reboot, I was able to install latest canary now IT shold be able to Update

roirraW "edor" ehT

#### Sunsparc

##### Senior Member
I followed these instructions exactly on my P6 (oriole) and got a bootloop after flashing the Magisk patched img. No matter what I have tried, I cannot get it to boot. I was previously on .036, unlocked and rooted. Not sure where I went wrong.

EDIT: I used Google's online flash tool as another person in this thread suggested and I'm out of bootloop. Just had to flash Magisk patched boot img afterward and back in business on .037 now.

Last edited:
roirraW "edor" ehT

### Top Liked Posts

• There are no posts matching your filters.
• 8
I don't know why folks continue to have issues updating when a new Android update is released. Despite Magisk having the option to install to an inactive slot for easy OTA updating, I simply avoid it and go the old-school route of updating via sideload to prevent any issues.

In hopes of putting to rest issues some of you face, here is what I do:

• Make a backup of all my important files in case something goes wrong
• Disable any Magisk modules if it makes you feel any safer
• Download the OTA image online and NOT from the system update!
• Reboot to recovery and sideload the OTA by using:
Code:
adb reboot sideload
• Then, in recovery I load up the file by using:
Code:
adb sideload "insert OTA file name here.zip"
• Once it finishes, you will be in recovery mode. Select "Reboot to system now".
• Once the system reboots, I unlock the device and let it finish completing the update before anything else.
I then proceed to root the device as I normally would, by:
• Getting the NEW boot.img file from the full factory image
• Copy it to my mobile device
• Open up Magisk and patch the boot.img file
• Copy the patched file to my PC
Code:
adb reboot bootloader

Then, patch the new boot.img using:

Code:
fastboot flash boot "patched_boot.img"

Reboot / Done.

I have not had it fail once using this process on stable Magisk and NO "disable" tags. The only reason I can see for anyone to use Canary versions of Magisk or "disable" tags, is if its absolutely required for some modules, ROMs, or kernels you are using. If it's not needed, just leave it alone.

You could technically just dirty flash the entire full factory image using the Android Flash Tool or flash-all.bat script on your PC, but the script file is where I find most folks mess up because they copy and pasted instructions improperly, or there's a line of code they forgot to add or remove without proofreading before running the script. I'd rather take matters into my own hands, even if it means completing more steps to make sure things go smoothly.

Anyway, I hope this helps someone!
4
What version of magisk are you using?

I updated the App, (but not the actual Magisk) to 24306 right before I started. I then copied over the boot.img, patched it with the new App, and copied it back to the PC. I then followed the instructions in the OP.

FYI. I still have "--disable-verity --disable-verification" in my update command line. I know it's not required with the new Magisk, but it's been working since the beginning and I see no reason to change it as I've had zero problems updating every month with it in there.

Best of luck!
3
So, it was a bit different for me this time. I was experimenting and was rooted with Magisk Alpha (t.me/magiskalpha) on 13 Beta 1 when Beta 2 was released. So, I decided to go back on official Magisk Canary, but I didn't re-root Beta 1 with official Canary. However, I installed the latest Canary apk on Beta 1 and patched Beta 2 boot.img and updated using the method I posted in OP.

I booted fine in Beta 2 but could not open Canary app (as was the case with everyone). I tried clearing data of the Canary app, tried reflashing patched boot.img, tried patching boot.img with Alpha and flashing on both slots before realizing that root wasn't working for anyone on Beta 2.

When update to Canary was announced, I simply downloaded the latest Canary apk, patched Beta 2 boot.img and flashed it in bootloader. Now, I haven't wiped my device in a long time and my verity and verification are not disabled (if there is any way to show that, please let me know and I will share it with everyone).

I was fortunate for not having to disable verity or verification (and in the process wipe data) like others on Beta 1.
3
I updated the App, (but not the actual Magisk) to 24306 right before I started. I then copied over the boot.img, patched it with the new App, and copied it back to the PC. I then followed the instructions in the OP.

FYI. I still have "--disable-verity --disable-verification" in my update command line. I know it's not required with the new Magisk, but it's been working since the beginning and I see no reason to change it as I've had zero problems updating every month with it in there.

Best of luck!
For anyone wondering, I was successfully able to update to the May patch with magisk canary 24307.
2
I don't know why folks continue to have issues updating when a new Android update is released. Despite Magisk having the option to install to an inactive slot for easy OTA updating, I simply avoid it and go the old-school route of updating via sideload to prevent any issues.

In hopes of putting to rest issues some of you face, here is what I do:

• Make a backup of all my important files in case something goes wrong
• Disable any Magisk modules if it makes you feel any safer
• Download the OTA image online and NOT from the system update!
• Reboot to recovery and sideload the OTA by using:
Code:
adb reboot sideload
• Then, in recovery I load up the file by using:
Code:
adb sideload "insert OTA file name here.zip"
• Once it finishes, you will be in recovery mode. Select "Reboot to system now".
• Once the system reboots, I unlock the device and let it finish completing the update before anything else.
I then proceed to root the device as I normally would, by:
• Getting the NEW boot.img file from the full factory image
• Copy it to my mobile device
• Open up Magisk and patch the boot.img file
• Copy the patched file to my PC
Code:
adb reboot bootloader

Then, patch the new boot.img using:

Code:
fastboot flash boot "patched_boot.img"

Reboot / Done.

I have not had it fail once using this process on stable Magisk and NO "disable" tags. The only reason I can see for anyone to use Canary versions of Magisk or "disable" tags, is if its absolutely required for some modules, ROMs, or kernels you are using. If it's not needed, just leave it alone.

You could technically just dirty flash the entire full factory image using the Android Flash Tool or flash-all.bat script on your PC, but the script file is where I find most folks mess up because they copy and pasted instructions improperly, or there's a line of code they forgot to add or remove without proofreading before running the script. I'd rather take matters into my own hands, even if it means completing more steps to make sure things go smoothly.

Anyway, I hope this helps someone!
Thanks for the guide bro, very useful. Out of curiosity, which Magisk did you use to patch the May boot.img?
Cheers
• 66
Caution: I originally wrote this guide when it was necessary to disable verity and verification before flashing patched boot.img. Now Magisk has overcome this requirement and some users have reportedly flashed updates without disabling verification and verity and did not have to wipe their phones, but request everyone, who have verification and verity disabled and using this guide, make sure you backup all the data and post your results here (I suggest backing up data anyway for everyone).

Following is a guide to update Pixel 6 Pro (perhaps all Pixel devices) every month, without wiping and retaining root. I tested it on my Pixel 6 Pro from 12.0.0 (SD1A.210817.015.A4, Oct 2021) to 12.0.0 (SD1A.210817.036, Nov 2021). There is no reason that it should not work on subsequent monthly patches, but just take the backups to be sure.

2) Extract the boot.img from image-raven-xxxxxxx.zip which was extracted from the image in the above step and patch it in Magisk Manager (latest canary build from https://github.com/topjohnwu/Magisk) on your phone and copy it back to the folder where you extracted the factory image and platform-tools. Rename the copied file to magisk_patched.img

3) Open flash-all.bat in notepad, add --skip-reboot and remove -w from the fastboot update line. Also add the following lines after the fastboot update line to flash the Magisk patched boot.img automatically:

ping -n 5 127.0.0.1 >nul
fastboot flash boot magisk_patched.img
fastboot reboot

After editing, the edited part of your flash-all.bat should look something like this:

Code:
fastboot --skip-reboot update [****image_name****]
ping -n 5 127.0.0.1 >nul
fastboot flash boot magisk_patched.img
fastboot reboot

echo Press any key to exit...

Note: [****image_name****] is just a placeholder and needs to be the name of zip file which was originally there in flash-all.bat, do not change that. Be careful to rename the Magisk patched boot.img to magisk_patched.img or in the alternative make appropriate modifications in the flash-all.bat

4) Open command prompt and go the folder where you extracted factory image and platform-tools. Type the following commands:

flash-all.bat

Your device should be upgraded to the latest factory image, while retaining root, without wiping data.

Update 1: I updated from 12.0.0 (SD1A.210817.036, Nov 2021) to 12.0.0 (SD1A.210817.037, Nov 2021) successfully using my method, without loosing data and root.

Update 2: I updated from 12.0.0 (SD1A.210817.037, Nov 2021) to 12.0.0 (SQ1D.211205.016.A1, Dec 2021) successfully using my method, without loosing data and root.

Update 3: I updated from 12.0.0 (SQ1D.211205.016.A1, Dec 2021) to 12.0.0 (SQ1D.220105.007, Jan 2022) successfully using my method, without loosing data and root.

Update 4: I updated from 12.0.0 (SQ1D.220105.007, Jan 2022) to 12.0.0 (SQ1D.220205.003, Feb 2022) successfully using my method, without loosing data and root.

Update 5: I updated from 12.0.0 (SQ1D.220205.003, Feb 2022) to Android 12L DP 3 successfully using my method, without loosing data and root.

Update 6: I updated from Android 12L DP 3 to Android 13 DP successfully using my method, without loosing data and root.
9
Just tried this on my P6Pro. Managed to update from .015 to .036 and retained root.
Also still passing SafetyNet with USNF 2.2 beta
8
I don't know why folks continue to have issues updating when a new Android update is released. Despite Magisk having the option to install to an inactive slot for easy OTA updating, I simply avoid it and go the old-school route of updating via sideload to prevent any issues.

In hopes of putting to rest issues some of you face, here is what I do:

• Make a backup of all my important files in case something goes wrong
• Disable any Magisk modules if it makes you feel any safer
• Download the OTA image online and NOT from the system update!
• Reboot to recovery and sideload the OTA by using:
Code:
adb reboot sideload
• Then, in recovery I load up the file by using:
Code:
adb sideload "insert OTA file name here.zip"
• Once it finishes, you will be in recovery mode. Select "Reboot to system now".
• Once the system reboots, I unlock the device and let it finish completing the update before anything else.
I then proceed to root the device as I normally would, by:
• Getting the NEW boot.img file from the full factory image
• Copy it to my mobile device
• Open up Magisk and patch the boot.img file
• Copy the patched file to my PC
Code:
adb reboot bootloader

Then, patch the new boot.img using:

Code:
fastboot flash boot "patched_boot.img"

Reboot / Done.

I have not had it fail once using this process on stable Magisk and NO "disable" tags. The only reason I can see for anyone to use Canary versions of Magisk or "disable" tags, is if its absolutely required for some modules, ROMs, or kernels you are using. If it's not needed, just leave it alone.

You could technically just dirty flash the entire full factory image using the Android Flash Tool or flash-all.bat script on your PC, but the script file is where I find most folks mess up because they copy and pasted instructions improperly, or there's a line of code they forgot to add or remove without proofreading before running the script. I'd rather take matters into my own hands, even if it means completing more steps to make sure things go smoothly.

Anyway, I hope this helps someone!
7
So I notice there are some people, like me, that are a bit confused on how to exactly do this process. I like to be nice every once in a while, so this is my time. I will try to do a step by step process with exactly how I did after reading, and re-reading all the comments on how to do it (with pictures cuz I need pictures to learn haha).

These are the exact steps I took when I updated from .36 to .37

Slapped the .37 zip file into a folder by itself so I can extract it inside that same folder. It should look like this once its extracted inside the same folder.

Then I opened another folder/window with the Platform-tools so I can easily navigate between the 2 folders.

Then I opened the flash-all.bat from the zipped folder, to see what it contains, noticed that it flashes 3 files/images.
“Image-raven-sd1a”

Then close the file as we dont need it right now.

So with this I know that I will need to add those 3 files to the platform-tools folder when I go to actually run the command.

I actually took the .37 boot.img and copied it into my pixel with version .36 still running.
The boot.img is inside the zipped folder and when you extracted it, it will now be viewable along with other files and the zipped folder still there.

copy this boot into the main folder of the pixel

On your Pixel, open Magisk and click install then select patch file, navigate to the boot.img file in your internal storage.
Patch it with Magisk and then take the patched boot.img (which that file will actually be in your downloads folder in your Pixel) and copied it back to my computer.

So as of now, it seems we are able to patch boot.img with current build without having to update then patch then flash. We can just patch on the current build then copy the patch to the computer and run the rest of the steps.

Now that I have the patched boot.img on my computer, I will take all the highlighted files in the picture, plus the patched boot.img over to the Platforms-tools folder and just copy them in that folder.
Here, I’m not sure how everyone else has their folder since I rarely use those tools, so I just add the files and then delete them after I’m done flashing. See picture of all copied in files. (dont forget your patched boot.img)

Now I will open the flash-all.bat that's inside the Platform-tools using Notepad ++ (personal preference).
Edit this file exactly like in the picture. Add the lines exactly how it shows in the picture.
**NOTE** that you need to type the exact patched boot file in there. So, like in this picture, but with YOUR patched "magisk_patched" file as this will have your own ID after 23014.

once you made the edits on this file, dont forget to save it before you run the commands!

Now plug in your phone to the computer.
Make sure you have USB debugging turned on.
Press shift and right click inside the Platform-tools folder and open Command Prompt.
run these 2 commands:
flash-all.bat

When it's all done, your phone will boot up and you will be on the new .37
Nothing else to add here as it will literally run through everything for you and boot up and you're done.

Hope this helps someone, as I am a visual learner myself.
7
couldnt we just add step 5 into the flash-all file? for example:
fastboot flash boot magisk_patched-xxxxx.img
fastboot reboot

like in the picture? or would it not actually run that way?
View attachment 5465521
holy poop that worked!! i was scared to try it myself but since i have a backup phone with all my data on it, it wouldnt be so bad to wipe the pixel if i messed it up doing it this way! But hey, it actually worked!!
here is the modified flash-all and yes you will need the "ping" line after the update line.

so with this, no need to type extra stuff, just add it all in the flash-all file and run the first 2 commands: