0

I have a Raspberry Pi 3B+ that I use for random tinkering projects.

What would be the correct way of backing up the entire "state" of the Pi, including any downloads, apps, scripts, settings, etc? Assume that only the SD card is used, not any other storage media.

The ideal outcome is that I can flash an entirely different project's image to the SD card, tinker with that, then go back to flashing the original SD card with all the settings / scripts / apps.

What's the best way to do this backup, and how do I flash the original file back to the SD card when I'm ready? Or is my only option simply buying an SD card for every "project"?

I'm currently using Raspbian but will probably use other OS's depending on the project I'm working on.

I found a similar question but that was asked 6 years ago, and was too advanced for me - I'm a beginner.

Pieter
  • 103
  • 2

2 Answers2

5

Best option is a complete clone of your SDCard as a bootable backup.

There's a tool in Raspbian to do that, all you need is a USB reader and a second SDCard that's the same size or bigger than your current SDCard.

SD Card Copier Tool

Dougie
  • 5,381
  • 11
  • 22
  • 30
3

@Dougie's answer will likely suit you best, but there are other solutions. One that has worked for me, and seems to have appeal for many others is called image-backup. Image-backup "creates a backup of a running Raspbian system to a standard 'raw' image file that can be written to an SD card". Here's why it might be better in some situations:

  • The backup is output to a file, not an SD card
  • It can do incremental backups (hourly, daily, on-demand, etc)
  • It does its backup job while the RPi is running

Note that it is invoked through the CLI, rather than the GUI.

Seamus
  • 23,558
  • 5
  • 42
  • 83