ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 8:27 am

Hi,
i have a Raspberry pi3 with a 32GB SD Card and all the things configured on it.
Now, i buyed a pi4 and i want to move this SD card from the pi3 to the pi4.
I read on the internet i can upgrade the SD card to use it on the pi4, but nobody say how.
How can i do this?
Thanks a lot in advance...

Christian

User avatar
HawaiianPi
Posts: 4243
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 8:39 am

Short answer, you can't.

The Pi4 uses a new version of Raspbian (Buster) and upgrading from one version to the next (Stretch to Buster) is not recommended.

Longer answer, you shouldn't.

If you look online you'll find ways to upgrade an older version to a newer one, but that's not recommended because it's not likely to work as expected. You may corrupt your card and end up with a non-bootable OS. Or it may boot up fine, giving you hope, only to find loads of stuff broken.

The bottom line is, it's almost certainly easier to start over from a fresh install, using your old card as a reference, then it will be to try and upgrade and then troubleshoot all of the problems you'll run into.
Last edited by HawaiianPi on Tue Jun 25, 2019 8:43 am, edited 1 time in total.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

fruitoftheloom
Posts: 19796
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 8:41 am

ducarpit wrote:
Tue Jun 25, 2019 8:27 am
Hi,
i have a Raspberry pi3 with a 32GB SD Card and all the things configured on it.
Now, i buyed a pi4 and i want to move this SD card from the pi3 to the pi4.
I read on the internet i can upgrade the SD card to use it on the pi4, but nobody say how.
How can i do this?
Thanks a lot in advance...

Christian

It is not recommended, but after making a full back up change the sources from Stretch to Buster:

This has a section for Jessie to Stretch, just change the names:

https://www.raspberrypi.org/documentati ... pdating.md


Personally just went with creating a fresh Raspbian Buster with Desktop SD Card......
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

User avatar
rpdom
Posts: 14456
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 11:41 am

One issue that may catch you out with the upgrade is that the recommended /boot partition size is now 100MB, which is a bit larger than it used to be. It may cause problems during upgrades now or in the future if it isn't resized.

I'm going to try an upgrade of a Stretch Lite Pi to Buster later today (probably) and see how it goes using these steps:

1. Backup working Stretch card to new card.

2. Boot on new card.

3. Change sources.list files.

4. apt-get update and dist-upgrade.

5. Check everything still works.

fruitoftheloom
Posts: 19796
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 12:21 pm

rpdom wrote:
Tue Jun 25, 2019 11:41 am
One issue that may catch you out with the upgrade is that the recommended /boot partition size is now 100MB, which is a bit larger than it used to be. It may cause problems during upgrades now or in the future if it isn't resized.

I'm going to try an upgrade of a Stretch Lite Pi to Buster later today (probably) and see how it goes using these steps:

1. Backup working Stretch card to new card.

2. Boot on new card.

3. Change sources.list files.

4. apt-get update and dist-upgrade.

5. Check everything still works.

On a fresh Raspbian Buster install it is a 256MB FAT32 Boot Partition ;)
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 12:29 pm

Hi, thanks to all.
But i know Buster is not available in the stable channel yet, am i right?
I read in the past in the middle of july....
Christian

fruitoftheloom
Posts: 19796
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 12:33 pm

ducarpit wrote:
Tue Jun 25, 2019 12:29 pm
Hi, thanks to all.
But i know Buster is not available in the stable channel yet, am i right?
I read in the past in the middle of july....
Christian

Raspbian Buster was released on the 20th June 2019

http://downloads.raspberrypi.org/raspbi ... _notes.txt


Maybe you are confusing with Debian Buster which is due official release some time early July 2019 ?
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 12:46 pm

fruitoftheloom wrote:
Tue Jun 25, 2019 12:33 pm
ducarpit wrote:
Tue Jun 25, 2019 12:29 pm
Hi, thanks to all.
But i know Buster is not available in the stable channel yet, am i right?
I read in the past in the middle of july....
Christian

Raspbian Buster was released on the 20th June 2019

http://downloads.raspberrypi.org/raspbi ... _notes.txt


Maybe you are confusing with Debian Buster which is due official release some time early July 2019 ?
Yes, i confused the two SO, sorry!

So i have to try to update from stretch to buster and resize (before) the /boot partition.
It doesn't seem simple ahaha

fruitoftheloom
Posts: 19796
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 12:51 pm

ducarpit wrote:
Tue Jun 25, 2019 12:46 pm
fruitoftheloom wrote:
Tue Jun 25, 2019 12:33 pm
ducarpit wrote:
Tue Jun 25, 2019 12:29 pm
Hi, thanks to all.
But i know Buster is not available in the stable channel yet, am i right?
I read in the past in the middle of july....
Christian

Raspbian Buster was released on the 20th June 2019

http://downloads.raspberrypi.org/raspbi ... _notes.txt


Maybe you are confusing with Debian Buster which is due official release some time early July 2019 ?
Yes, i confused the two SO, sorry!

So i have to try to update from stretch to buster and resize (before) the /boot partition.
It doesn't seem simple ahaha

The best advice as always is to start with a fresh install, Buster works well on my RPi 2B v1.1
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

ralphrmartin
Posts: 11
Joined: Sat May 06, 2017 3:42 pm

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 4:19 pm

I had a RPi 3 booting from the SD, but with the main OS on a USB HD. (I.E. /boot was the SD, / was the HD).
Here's how I replaced it with an RPi 4:
Edit /etc/apt/sources.list replacing "stretch" by "buster"
Edit /etc/apt/sources.list.d/raspi.list replacing "stretch" by "buster"
sudo apt update
sudo apt dist-upgrade
reboot, check it works OK.
Remove SD, USB HD, plug them into RPi 4
Boot

All was working OK for me.

This was for a machine used as a web server. I can't promise it will work for you using the RPi as a desktop etc.

fruitoftheloom
Posts: 19796
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 4:40 pm

Buster Blog including full instructions how to go from Stretch to Buster at your own volition:

https://www.raspberrypi.org/blog/buster ... -raspbian/
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 5:35 pm

ralphrmartin wrote:
Tue Jun 25, 2019 4:19 pm
I had a RPi 3 booting from the SD, but with the main OS on a USB HD. (I.E. /boot was the SD, / was the HD).
Here's how I replaced it with an RPi 4:
Edit /etc/apt/sources.list replacing "stretch" by "buster"
Edit /etc/apt/sources.list.d/raspi.list replacing "stretch" by "buster"
sudo apt update
sudo apt dist-upgrade
reboot, check it works OK.
Remove SD, USB HD, plug them into RPi 4
Boot

All was working OK for me.

This was for a machine used as a web server. I can't promise it will work for you using the RPi as a desktop etc.
Did you expand the /boot partition from 100mb to 256mb? Other users below said this.....

User avatar
thagrol
Posts: 1616
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 9:04 pm

rpdom wrote:
Tue Jun 25, 2019 11:41 am
One issue that may catch you out with the upgrade is that the recommended /boot partition size is now 100MB, which is a bit larger than it used to be. It may cause problems during upgrades now or in the future if it isn't resized.
I'd expect problems doing that. Last time I tried the library used by fdisk and/or gparted couldn't resize FAT partitions as small as the one used by raspbian.

It can be done, but it's not trivial:
  1. Backup your SD card
  2. Boot from a second SD card
  3. Connect the original SD card via a USB card reader but do not mount it
  4. (Assuming the desktop here) Launch gparted and select the original SD card
  5. Reduce the size of the root partition and move it's start position to the right.
  6. Delete the existing FAT partition
  7. Createa new one of the desired size
  8. Write changes to disc
  9. Close gparted
  10. Mount the root partition of the original Sd card
  11. Edit /etc/fstab so that the entry for /boot matches the new partition (either use the new PARTUUID, UUID, or /dev/mmcblk0p1)
  12. Unmount the root partition and moun the /boot partition
  13. Copy the files for /boot from your backup to the new partition
  14. Shutdown, swap SD cards and boot.
This space unintentionally left blank.

ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 9:40 pm

thagrol wrote:
Tue Jun 25, 2019 9:04 pm
rpdom wrote:
Tue Jun 25, 2019 11:41 am
One issue that may catch you out with the upgrade is that the recommended /boot partition size is now 100MB, which is a bit larger than it used to be. It may cause problems during upgrades now or in the future if it isn't resized.
I'd expect problems doing that. Last time I tried the library used by fdisk and/or gparted couldn't resize FAT partitions as small as the one used by raspbian.

It can be done, but it's not trivial:
  1. Backup your SD card
  2. Boot from a second SD card
  3. Connect the original SD card via a USB card reader but do not mount it
  4. (Assuming the desktop here) Launch gparted and select the original SD card
  5. Reduce the size of the root partition and move it's start position to the right.
  6. Delete the existing FAT partition
  7. Createa new one of the desired size
  8. Write changes to disc
  9. Close gparted
  10. Mount the root partition of the original Sd card
  11. Edit /etc/fstab so that the entry for /boot matches the new partition (either use the new PARTUUID, UUID, or /dev/mmcblk0p1)
  12. Unmount the root partition and moun the /boot partition
  13. Copy the files for /boot from your backup to the new partition
  14. Shutdown, swap SD cards and boot.
Hi, congratulation, very very good idea.
But i have some questions:
Point 2/3/4: i can do this also with a PC with a Linux distributions, am i right? I think it's not necessary another raspberry...i can use my PC and insert the SD card in a USB adapter.
Point 6/7: why have i to delete and then recreate the /boot partition? After reducing the /root, i have space at right to enlarge the /boot partition. I think it is not necessary to delete it, recreate it and the restore the files on it.

Correct me if i am wrong.
Thanks a lot
Christian

User avatar
thagrol
Posts: 1616
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: How can i upgrade a pi3 SD card to pi4?

Tue Jun 25, 2019 10:06 pm

ducarpit wrote:
Tue Jun 25, 2019 9:40 pm

Hi, congratulation, very very good idea.
But i have some questions:
Point 2/3/4: i can do this also with a PC with a Linux distributions, am i right? I think it's not necessary another raspberry...i can use my PC and insert the SD card in a USB adapter.
Yep and for steps 10 - 13.
Point 6/7: why have i to delete and then recreate the /boot partition?
Because fdisk/gparted can't resize a FAT partition as small as the one used by raspbian
After reducing the /root, i have space at right to enlarge the /boot partition. I think it is not necessary to delete it, recreate it and the restore the files on it.
The disc space used by a partition has to be contiguous. You can't split it between space at the start of the disc and space at the end. Well you probably can using LVM et al but that ain't gonna work for the /boot partition.

You have to move the root partition so that the free space is between the existing FAT partition and the start of the root partition.

As stated above, the current partitioning tools cannot handle resizing a FAT partition of the size of the /boot partition in raspbian stretch (and earlier). If you want to enlarge it, you have no choice but to delete it and recreate it.

I'm not sure what the lower limit for increasing the FAT partition size is. You may find it'l work with a sufficiently large value, however that may then be too big for what's going on it.

A windows PC might be able to do it but, frankly, I wouldn't trust windows to make changes to linux partitions.
This space unintentionally left blank.

Andryshik345
Posts: 1
Joined: Wed Jun 26, 2019 8:40 am

Re: How can i upgrade a pi3 SD card to pi4?

Wed Jun 26, 2019 8:44 am

Can I just replace SD card from my RPi 3 with Raspian Stretch to RPi 4 and continue to use the configured system?

ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

Re: How can i upgrade a pi3 SD card to pi4?

Wed Jun 26, 2019 8:54 am

thagrol wrote:
Tue Jun 25, 2019 10:06 pm
ducarpit wrote:
Tue Jun 25, 2019 9:40 pm

Hi, congratulation, very very good idea.
But i have some questions:
Point 2/3/4: i can do this also with a PC with a Linux distributions, am i right? I think it's not necessary another raspberry...i can use my PC and insert the SD card in a USB adapter.
Yep and for steps 10 - 13.
Point 6/7: why have i to delete and then recreate the /boot partition?
Because fdisk/gparted can't resize a FAT partition as small as the one used by raspbian
After reducing the /root, i have space at right to enlarge the /boot partition. I think it is not necessary to delete it, recreate it and the restore the files on it.
The disc space used by a partition has to be contiguous. You can't split it between space at the start of the disc and space at the end. Well you probably can using LVM et al but that ain't gonna work for the /boot partition.

You have to move the root partition so that the free space is between the existing FAT partition and the start of the root partition.

As stated above, the current partitioning tools cannot handle resizing a FAT partition of the size of the /boot partition in raspbian stretch (and earlier). If you want to enlarge it, you have no choice but to delete it and recreate it.

I'm not sure what the lower limit for increasing the FAT partition size is. You may find it'l work with a sufficiently large value, however that may then be too big for what's going on it.

A windows PC might be able to do it but, frankly, I wouldn't trust windows to make changes to linux partitions.
Ok, no problems, thank a lot. This evening i will try to expand the /boot partition from 100MB to 256MB (at least). Then, i will inform you how the test is gone.
Thanks a lot

Christian

ducarpit
Posts: 71
Joined: Mon Jan 09, 2017 8:32 am

Re: How can i upgrade a pi3 SD card to pi4?

Wed Jun 26, 2019 6:06 pm

thagrol wrote:
Tue Jun 25, 2019 10:06 pm
ducarpit wrote:
Tue Jun 25, 2019 9:40 pm

Hi, congratulation, very very good idea.
But i have some questions:
Point 2/3/4: i can do this also with a PC with a Linux distributions, am i right? I think it's not necessary another raspberry...i can use my PC and insert the SD card in a USB adapter.
Yep and for steps 10 - 13.
Point 6/7: why have i to delete and then recreate the /boot partition?
Because fdisk/gparted can't resize a FAT partition as small as the one used by raspbian
After reducing the /root, i have space at right to enlarge the /boot partition. I think it is not necessary to delete it, recreate it and the restore the files on it.
The disc space used by a partition has to be contiguous. You can't split it between space at the start of the disc and space at the end. Well you probably can using LVM et al but that ain't gonna work for the /boot partition.

You have to move the root partition so that the free space is between the existing FAT partition and the start of the root partition.

As stated above, the current partitioning tools cannot handle resizing a FAT partition of the size of the /boot partition in raspbian stretch (and earlier). If you want to enlarge it, you have no choice but to delete it and recreate it.

I'm not sure what the lower limit for increasing the FAT partition size is. You may find it'l work with a sufficiently large value, however that may then be too big for what's going on it.

A windows PC might be able to do it but, frankly, I wouldn't trust windows to make changes to linux partitions.

Hi, i have just done this operations on my Raspberry and all is OK.
At the moment i am monitoring it to trust if it it stable and all is OK.
I rsized the /boot partition from 100MB to 500MB (i am a little bit megalomaniac :D ).
Tomorrow, if it's all OK, i will upgrade from scratch to buster.
Then i will inform you how the upgrade was gone.
Best regards

Christian

Return to “Advanced users”