On an external 2-tb hdd with usb 3.0 and external power supply. i also managed to get an exactly same to do this backup. Original NC hdd is formatted as btrfs and the backup disk is still in ntfs, i think.
I need to run tar
first to make a zip-like file, and then i make a copy of the mysql database, right? I don´t run both commands in the same command?
Yes. You run both commands separately.
Try with -P flag.
tar -Pcf /media/myCloudDrive/nextcloud-bkp.tar /media/myCloudDrive/ncdata /var/www/nextcloud
tar -Pcf /media/myCloudDrive/nextcloud-bkp.tar /media/myCloudDrive/ncdata /var/www/nextcloud
You are backing up to the same hdd. Check the mountpoint from my previous answer.
sorry, my mistake.
I can hear the hdd´s spinning now. Exciting!
It is possible that you will run into permission issues. Can you change root password from here :
Okay, thanks for the warning.
How do I know when tar
is finished?
You will get the prompt back ($ sign).
You could also add the -v flag
tar -Pcvf /media/myCloudDrive/nextcloud-bkp.tar /media/myCloudDrive/ncdata /var/www/nextcloud
You can also start a second ssh and backup your database.
I think it might be better to just start the backup again with -v flag so you can know thethe errors.
You can stop tar by pressing ctrl + c
so tar -v -pcvf [...]
?
seems like tar is not one of the easy commands
tar -Pcvf
Sorry , i somehow missed this answer.
No problem. Do you get permission errors ?
no, not so far. although i´m not backing up the database yet. data is backing up just fine.
You should know that your database contains your contacts, calendar, deck cards, todo lists, perhaps your cookbooks, etc
I know I know. I’m just waiting for the tar to finish because I don’t want to stress the little pi 4 too much.
Oh ok. I thought you were not going to backup database at all.
Anyway if it does not work for some reason then you can also start ubuntu from live usb / in virtualbox, connect your drive and sdcard then use the file explorer to copy your database and data folder.
mysqldump: Error 1034: Index for table 'oc_activity' is corrupt; try to repair it when dumping table 'oc_activity' at row: 11914
mmmhhh…
guess i´ll make a ubuntu usb stick tomorrow.
hey guys, an update.
I tried to make a backup, but it never seemed to finish, I never saw the prompt ($) again. I also tried to make a backup of the database. I tried several times, but I don´t know if it completely copied all files. the tar file on my backup is only about one third in size.
I guess due to all the reboots somehow my sd-card, where the pi is booting from, became corrupted. I can see that there is a device on Ethernet port 1 on my router, but I can not get a ping, see an ip adress, connect to the know ip adress and i don´t get a signal on the hdmi ports when i connect a monitor.
I will try to get a ubunutu boot stick ready and see ich i can copy my files from there and then do a complete wipe and reinstall from nextcloud pi.
Thanks for your knowledge and help!!