I’m looking for something like Debian:
dpkg --get-selections > deb.list
dpkg --set-selections < deb.list
apt-get dselect-upgrade
for NC (dump/restore configuration)
I have found that it’s not enough copy config.php (and db)
I imagine:
sudo -u www-data php ./occ app:list:available
sudo -u www-data php ./occ app:list:installed > app.list.txt
sudo -u www-data php ./occ app:enable < app.list.txt
I have found this after re-unzip latest-12.zip in an already installed (and working) NC
mv nextcloud nextcloud.old;
unzip latest-12.zip
cp nextcloud.old/config/config.php nextcloud/config/
cd nextcloud
sudo -u www-data php ./occ maintenance:update:htaccess
The nextcloud/apps folder? But you should of course not replace the new core apps with the old ones, just the additional installed apps that do not replace something new.
Ciao @MichaIng
so, this should works (from the FileSystem point of view, for Database -> usual dump/restore)
mv nextcloud nextcloud.old
unzip latest-12.zip
cp nextcloud.old/config/config.php nextcloud/config/
cd nextcloud
rsync -au …/nextcloud.old/apps/ apps/
sudo -u www-data php ./occ maintenance:update:htaccess
cd …
diff -r nextcloud.12.1 nextcloud
Only in nextcloud: data
Could make a howto out of it . Does "rsync -u " also leaves out newer folders, or only files? Otherwise theoretically newly removed core apps files could be copied over and produce integrity check errors.
From the man page:
-u "… Note that this does not affect the copying of dirs, symlinks, or other special files."
IF there are files and dirs in apps/ directory, this means that that app are installed (presents also into the DB)
The apps in nc.old should have older date/time (or at least the same) than the one in nc (new) so they are not copied into the new installation.
So the rsync command should be safe.
I mean it could happen, that developers remove one/some apps files inside the related apps subfolder during updates. As in this case, no newer file remains in the new nextcloud/apps/subfolder, but none, the old file would be copied in place again (this was my question). The new old file should just be ignored by nextcloud/the app, so should not be any harm, but the integrity check would recognize an extra file and besides the message refuse updates via web updater e.g.
The cases for this will be rare, so in your case, everything will be fine (and anyway easy to solve), but before putting the steps into a howto, it should be still resolved .
It took a while to understand the misunderstanding…
My original question was about to clone a NC installation between 2 different server or same server and different setup, but THE SAME VERSION.
“old” and “new” were relative to installed / to install (again)
As you pointed out, default apps can change between different version.