Use Dietpi-Backup to restore on a fresh image?

I recently experienced an issue with my Dietpi installation. In short I can’t connect to the Web server even though everything seems to be running. I made Backup on a fresh install with everything configured initially. Since then I’ve reformatted that machine and have the current configuration which is not working. I made an off-line backup of dietpi-backup_system.tgz to another system. How do I use that to restore the operating system?

I’ve tried with a fresh install with Dietpi-Backup to restore. I get the following error message “/mnt/dietpi-backup/.dietpi-backup_system_stats does not exist”

Apparently the backup is not fully self-contained and restorable?
I would’ve had to back up the entire dietpi-backup directory to make it restorable instead of the .tgz file. if so that is not clear in the documentation or the tool itself.

To anyone else experiencing this issue this is probably the fix. Changes were made to the Dietpi-backup script. Any backups made Prior to Dietpi 142 will not work on the new system. The ticket below contains instructions to restore with the old system.
https://github.com/Fourdee/DietPi/issues/685

The above fix does not work for me. As .dietpi-backup_settings does not exist.

Hi Zone,

What happens if we move the old settings back, as per https://github.com/Fourdee/DietPi/issues/685#issuecomment-270145794?

mv /DietPi/dietpi/.dietpi-backup_settings_v141 /DietPi/dietpi/.dietpi-backup_settings

Failing that, lets try and find it:

ls -lha /DietPi/dietpi/ | grep backup

How is this supposed to work on a system that’s never made a backup? Therefore .dietpi-backup_settings doesn’t exist. In essence I have the contents of the backup via dietpi-backup_system.tgz but I don’t in any form in either system have ‘.dietpi-backup_settings’ as verified by

ls -lha /DietPi/dietpi/ | grep backup

DietPi-Backup does not support a compressed backup, so you’ll need to unzip to /mnt/dietpi-backup

Then run dietpi-backup > location > search

EDIT: And if your backup was created with v141 or lower, make sure you download the old DietPi-Backup script:
https://github.com/Fourdee/DietPi/issues/685#issuecomment-270145794

Okay I’ve tried with the old system (instructions for prior versions to 142v)and the new system and the default dietpi_backup for versions equal to or greater than 142v)

root@DietPi:~# ls -lha /DietPi/dietpi/ | grep backup                                         
-rwxr-xr-x 1 root root  19K Feb  3 21:19 dietpi-backup
-rw-r--r-- 1 root root   36 Feb  3 21:25 .dietpi-backup_settings

I’ve extracted dietpi-backup_system.tgz into /mnt/

root@DietPi:/mnt# ls
dietpi-backup_system  dietpi_userdata  ftp_client  nfs_client  samba  usb_1

both versions of the backup program expect dietpi-backup when my folders named dietpi-backup_system. I’ve tried renaming it to dietpi-backup to no effect Both backup system say something similar to this.

 FP_TARGET_BACKUP=/mnt/dietpi-backup                             
             │                                                                            
             │ Your current location is not supported.                  
             │ The location must be inside the /mnt/* directory.  
             │  - eg: /mnt/dietpi-backup

OK I believe I got it to work.

  1. A fresh image Up-to-date 143v

  2. set up dietpi only openSSH instead of beardrop

  3. create a backup through dietpi-launcher
    This creates two files
    dietpi-backup_system
    .dietpi-backup_settings

  4. navigate to /mnt/dietpi-backup ‘cd /mnt/dietpi-backup’

  5. remove the newly generated dietpi-backup folder ‘rm -f -r dietpi-backup’

  6. transfer over FTP dietpi-backup_system.tgz to ‘mnt/dietpi-backup’

  7. untar your dietpi-backup_system.tgz ‘’

  8. Optional - edit .dietpi-backup_settings to reflect the date of your backup ‘nano .dietpi-backup_settings’

  9. Run restore

And this is a boot error after restore

Will test above procedure with previous old backup script
https://github.com/Fourdee/DietPi/issues/685#issuecomment-270145794

Considering dietpi-backup_system.tgz’s filename I can presume that it been created with 142 or later.
My logic is the new backup system names dietpi-backup_system or dietpi-backup_full depending on if the end user would like the files from the data directory. Am I correct in that assumption?

Okay I restored the using old method successfully although I run the same Boot error as depicted in the dropbox link. Given the fact that this error persists across both methods I would say there’s an issue with how my setup was backedup/restored by diedpi-backup. Let me know how I can help.

Yes, new system from v142 onwards, creates 2 settings files:

.dietpi-backup_system_stats
.dietpi-backup_userdata_stats # if USER DATA is enabled for backup



Okay I restored the using old method successfully although I run the same Boot error as depicted in the dropbox link. Given the fact that this error persists across both methods I would say there’s an issue with how my setup was backedup/restored by diedpi-backup. Let me know how I can help.

Looks like an issue with uboot.

Ok, restore your backup, then, before rebooting, update the DietPi Kernel. This should replace uboot/kernel/modules with a working version.
Copy/Paste all into term

install_url_address='http://dietpi.com/downloads/binaries/rpi/dietpi_rpi_kernel.zip'

# - Prevent kernel/firmware/bootloader upgrades from Raspbian repo
apt-mark hold raspberrypi-bootloader raspberrypi-kernel

wget "$install_url_address" -O package.zip
rm -R /boot/overlays/*
rm -R /lib/modules/*
rm -R /lib/firmware/*
rm /boot/*.img

unzip -o package.zip -d /

rm package.zip

# - flag,
echo 1 > /etc/dietpi/.dietpi_rpi

If that still fails, compare your /boot/cmdline.txt with:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Same problem

root@DietPi:/# install_url_address='http://dietpi.com/downloads/binaries/rpi/dietpi_rpi_kernel.zip'
root@DietPi:/# apt-mark hold raspberrypi-bootloader raspberrypi-kernel
E: Unable to locate package raspberrypi-bootloader
E: Unable to locate package raspberrypi-kernel
E: No packages found
root@DietPi:/# wget "$install_url_address" -O package.zip
--2017-02-05 14:39:52--  http://dietpi.com/downloads/binaries/rpi/dietpi_rpi_kernel.zip
Resolving dietpi.com (dietpi.com)... 185.101.92.145
Connecting to dietpi.com (dietpi.com)|185.101.92.145|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 61679042 (59M) [application/zip]
Saving to: ‘package.zip’

package.zip              100%[=================================>]  58.82M   433KB/s   in 4m 34s

2017-02-05 14:44:26 (220 KB/s) - ‘package.zip’ saved [61679042/61679042]

root@DietPi:/# rm -R /boot/overlays/*
rm: cannot remove ‘/boot/overlays/*’: No such file or directory
root@DietPi:/# rm -R /lib/modules/*
root@DietPi:/# rm -R /lib/firmware/*
root@DietPi:/# rm /boot/*.img
rm: cannot remove ‘/boot/*.img’: No such file or directory
root@DietPi:/# unzip -o package.zip -d /
...

root@DietPi:/# rm package.zip
root@DietPi:/# echo 1 > /etc/dietpi/.dietpi_rpi
root@DietPi:/#

Were do I find ‘/boot/cmdline.txt’? I do not see it on the sd card on windows 10 or do I have to look for it before restoring in dietpi.

@Fourdee can you point me in the right direction regarding where to find /boot/cmdline.txt?

I’ve given up trying to restore on a fresh image due to lack of support to answer my previous question. :thinking: