-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data folder deleted after restoring from data-less backup #1417
Comments
That is what I have discovered a month ago. Just wanted to restore the "dataless" Backup and all my Data was gone after that. But luckily I had an external backup. |
That is to be expected. Bear in mind that the php code for Nextcloud is also in the volume together with the data. In the non-docker case, if we have moved the data, then it will honor that but that is a quirk. If you restore a dataless backup in the general case you end up with a clean instance, with the exception I mentioned before |
Thank you for clarification! Indeed I am using the Docker-Version of Nextcloudpi. Again thank you for clarification and have a nice day! :) |
Now it happened! I lost my data by restoring a data-less backup!! |
Reopen please! |
I'll have another look at this |
Thank you! |
+1 Bumping this
|
+1 Bumping this, a note for when I have the time, or if theCalcaholic looks at it before me
|
I have drafted a fix for this: #1601 It's still untested and can be improved |
- nc-restore: Keep old data directory if present - nc-restore: Temporarily move and restore user files during nc-restore Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
- nc-restore: Keep old data directory if present - nc-restore: Temporarily move and restore user files during nc-restore Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
- nc-restore: Keep old data directory if present - nc-restore: Temporarily move and restore user files during nc-restore Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com> Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
The change is now included in version v1.50.5 |
I just had massive problems restoring my ncp docker instance after some files got corrupted (due to worn-out SD-card!?)
I make data-less ncp backups every 2nd day and use my own rsync script to backup the data folder. The corrupted files were not part of the data folder!
My expectation was to reinstanciate my docker container, mount the same data volume as before, run the ncp-restore and have a happy day.
BUT:
After running the ncp-restore with my data-less archive, I realized all the data was gone.
The problem seems to be these 2 lines in the nc-restore script:
nextcloudpi/bin/ncp/BACKUPS/nc-restore.sh
Lines 66 to 67 in dd8fc3d
Here, the nextcloud folder gets deleted and replaced by the one from the backup.
What seems to be good for a backup WITH data can lead to a nightmare in case of a data-less backup. Luckily, I had my own backup of the data folder!!
To fix this, I ran the script step by step and replaced the lines with an rsync command.
The text was updated successfully, but these errors were encountered: