What to backup and restore between cards?

I have a Shake that’s been working without issue for some time! I happened to see what the latest news was with the project and looks like mine has already been updated and just keeps posting data as it has been.

Taking stock though, I realize that the more time goes by the more I forget how I even set it up in the first place. Also I see a note in the latest release Shake-OS V21.2 · raspberryShake-public / Raspshake Sd Img · GitLab

Includes support for 4 Model B, including latest Pi Foundation builds

which I wonder if it means updated to a supported version of Debian again that still gets security updates? [UPDATE: nope, looks like it’s still on Raspbian 10 :-/] I’m burning a new card to take a peek but this has gotten me thinking, how would I migrate to a new card?

Specifically where is my configuration data stored? I think that I must have at least configured it with:

  • my login to the public share server?
  • any little settings, including I must have set it up to store data to a USB drive somehow since I see that in /opt/data/archive
  • anything else?

Basically if my current SD card were to fail, or if I were to swap in this new one I’m burning to (maybe?) get a newer Debian base OS, what data would I wish that I had retained from this current SD card and at what paths is it stored?

Hello natevw, and welcome to our community!

The good news is that right now, setting up a Raspberry Shake is much simpler and faster thanks to the newly implemented guided process.

However, if you want to be extra sure about all the details you entered the first time, this is what you need to know:

  1. Station Registration & Network Credentials
    • Your station name (R####) is tied to your Shake’s hardware (MAC address)
    • If you have created an account with us, all your account information is safely stored in our authentication server
  2. Then, if you want, you can backup:
    • /opt/settings/sys/: system settings, including network configuration
    • /opt/settings/user/: user-specific settings
  3. And, lastly, data storage
    • /opt/data/archive/: all your waveform data

Probably, to make things simpler, you could simply screenshot all the relevant rs.local/ settings pages instead of backupping all directories/files. However, if you had dedicated modifications or configurations, file backup is recommended.

Thanks, based on those patterns I looked around a bit more and did also find /opt/settings/config/config.json which seems to maybe be ± the only stuff I might have really had to configure?

For most other Pis/VMs I like to have an Ansible playbook which even if/when not fully automated tends to at least document what all has to be done to deploy it. I skipped that originally and basically just trying to backfill now before more years fade the memory.

Some of this is coming back as I pull back up some documentation. I guess the main connection to your API(s) happens automatically via the MAC address.

The drive setup I must have followed https://manual.raspberryshake.org/usbsds.html specifically adding an entry in /etc/fstab which I’d want to capture. AFAICT then Shake software just automatically detects that [or perhaps always just writes to that path whether on root filesystem or shadowed by another mount] and there’s nothing to really “enable” besides the mount itself.

I’ve also updated the password (and tweaked the SSH settings to reject password anyway). And maybe that’s about it? So to re-provision I think I would need to:

  1. Image a new SD card: https://manual.raspberryshake.org/burnSD.html
  2. Restore my /opt/settings/config/config.json (dataSharing and its location info)
  3. Ensure lineinfile for /etc/fstab in my case /dev/sda1 /opt/data/archive ext4 noatime,data=writeback
  4. Comment out the PasswordAuthentication yes (and perhaps the UsePAM yes) line(s) in /etc/ssh/sshd_config
  5. Change myshake user password and/or touch /opt/settings/user/.pwchanged so WebUI doesn’t worry

And of course preserve the (in my case external) data on the /opt/data/archive mount.

Appreciate the tips. Most of the above is really kinda just my own notes now but collecting/posting them in public in case they’re helpful to others (and/or need further correction downthread :sweat_smile:).

1 Like

Oh absolutely! Having this kind of step-by-step list will surely help anyone else who wants to approach things in the same way.

Thank you for taking the time to compile it, and no trouble at all for the tips.

1 Like