1 to 1 backup to another drive

I have x86 dietpi running fine but foolishly it’s on a 1TB SSD. Now I realise I don’t need all that storage and I could use the drive elsewhere, I need to swap in a 120GB SSD.
TBH even 120GB is overkill :slight_smile:

So how do I go about making a 1 to 1 backup on the new drive, and ensure it will boot?
There are 2 websites, various database’s, PiHole with a lot of settings, and a couple of other things and personal tweaks that would take an age to re-apply (I can’t remember all the changes I made!)

TIA
Daz.

Thank Joulinar, sadly something went VERY wrong, windows dropped the drive (attached via USB) during the process of making the IMG file. Result - corrupt IMG file and corrupt drive.

Looks like I have no choice but to start fresh again :frowning:
I’m 99% there…

Actually Joulinar, I made a backup - dietpi-backup before I started, would that restore all my settings, it would save me setting up again. I mean I’ve set the software back up, but there’s a lot of tweaking to be done with apache servers etc, and I don’t want the pain!

Would a dietpi-restore have saved me all the trouble?

If you have a complete backup, it should restore the entire system as it was before

Yes, it should work with these steps (assuming your backup is on a USB device):

  1. Set up a new DietPi system with the smaller SSD

  2. Connect the USB device with your DietPi backup located on it to the new DietPi system

  3. Mount the USB device via dietpi-drive_manager

  4. Start dietpi-backup

  5. Set the location of the backup to the mounting point of the USB device

  6. If you set the location correctly, dietpi-backup reports the date of the last backup (on the USB device) in its header. If not, the backup location is not set correctly

  7. Start the Restore