Hi,
recently, my NextCloud crashed. Instead of looking for the problem and its possible solution (as I have done multiple times in the past), I now want to just restore all the user files onto a new NextCloud installation. The installation of NextCloud v25.0.3.2 via NextCloudPi v1.51.0 went fine, so far.
My old files are fortunately stored below a ncdata
folder on an external SSD which I have now plugged to the newly installed NextCloud device. And moved into a backup folder.
here is part of a backup folder:
-rw-r--r-- 1 www-data www-data 268724 9. Jun 2021 comm_email.c
-rw-r--r-- 1 www-data www-data 6482 27. Dez 2020 comm_email.py
-rw-r--r-- 1 www-data www-data 248106 16. Jan 2022 comm_signal.c
-rw-r--r-- 1 www-data www-data 4536 16. Jan 2022 comm_signal.py
-rw-r--r-- 1 www-data www-data 506 14. Nov 2018 contacts_individual.ini
-rw-r--r-- 1 www-data www-data 1878 14. Apr 2020 contacts.ini
the file creation dates are correct.
Now, the new ncdata
and ncdatabase
folders were at first empty and, via configuration, ready to be used wihtin NextCloud. I did the following:
-
I used bash’s
cp
command to transfer the old user folders from the backup location to belowncdata/data/
. About 7 GB of data. -
I issued the following command to scan the newly tranferred files into the NextCloud database:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all
. This worked fine.
Looking into the respective folder now, after occ
's scan command has done its job, I see:
-rw-r--r-- 1 www-data www-data 268724 7. Feb 23:13 comm_email.c
-rw-r--r-- 1 www-data www-data 6482 7. Feb 23:13 comm_email.py
-rw-r--r-- 1 www-data www-data 248106 7. Feb 23:13 comm_signal.c
-rw-r--r-- 1 www-data www-data 4536 7. Feb 23:13 comm_signal.py
-rw-r--r-- 1 www-data www-data 506 7. Feb 23:13 contacts_individual.ini
-rw-r--r-- 1 www-data www-data 1878 7. Feb 23:13 contacts.ini
=> all the file’s creation dates have been set to the date where the occ
command did its job.
This is not what I intended to happen, as I want to revover the files and keep their modification dates. This is important in order to not override changes different users could have made during the current downtime of the NextCloud service.
Looking up the documentation for the scan function of occ shows that there is no option to tell NextCloud to actually keep the existing modification dates.
Is there any way to restore the original file modification dates of my files? Shouldn’t there be an option like this to do that?
Thanks.