It is good practice to keep Raspberry Pi devices running the latest version of the OS and kernel. Raspbian is a debian distribution (dist) of linux. To see debian version names, or to find the latest version name go to debian.org.
If you are moving from one OS version up to another version, then go through each version upgrade. Don't try to jump multiple versions. So, instead of going from from wheezy to stretch, go from wheezy to jessie, and from jessie to stretch.
Upgrading two versions will take several hours.
Parts:
Raspberry Pi running raspbian
Step 1. Backup microSD Card imag
Step 2. Open a Terminal Window and Login
Step 3. Check linux distribution and version number
Raspbian is dist of debian. Check the debian project names and release numbers
Run the following command to find the Linux distribution and version
$ lsb_release -a
If not raspbian, then stop
Step 4. Aways Update and Upgrade
Step 5. Upgrade the OS
Run the following command:
$ sudo apt-get dist-upgrade -y
I have not tried this (next time):
$ sudo apt full-upgrade -y
Of course a dist-upgrade takes forever. Turn off sleep on your MacBook (Preferences, Energy Saver, Check: Prevent computer from sleeping automatically when the display is off), and go do something else.
At the end of the commands, you may get recommendations to run other commands. Be sure to follow any instructions given. Often the instructions will assume you are running as root, so you may need to add sudo before any recommended command.
Step 6. Cleanup
Remove the files you don't need any more
$ sudo apt-get --purge -y autoremove
Step 7. Reboot
$ sudo reboot
Step 8. Check kernel and OS
Show kernel version:
$ uname -a
Other ways to check on the command-line for a linux OS version:
$ cat /etc/os-release
$ hostnamectl
Step 9. Edit Sources
If the Raspberry Pi is at the desired version, then go to Step 10.
Otherwise, edit sources changing from current dist to next dist (e.g., wheezy to jessie, then jessie to stretch, stretch to buster)
$ sudo nano /etc/apt/sources.list
And edit each file below in the same way
$ sudo ls /etc/apt/sources.list.d/
Go back to Step 5 and repeat all the steps for the next version.
Step 10. Check settings
To run the standard configuration tool:
$ sudo raspi-config
Step 11. Check your application
Check to make sure your application still works as desired