From 0decfe49000f7dd4c2819d74842e56bf15fc8c28 Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 25 Oct 2023 07:39:09 -0700 Subject: [PATCH 1/4] Update migration.md with info about synchronization Add information about synchronizing after migration. There maybe issues if the server has been offline for a while and a user reconnects clients for synchronization. Signed-off-by: Lance --- migration.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/migration.md b/migration.md index db40e281..0cac55ce 100644 --- a/migration.md +++ b/migration.md @@ -86,3 +86,15 @@ If not, feel free to restore the AIO instance from backup and start at step 8 ag ## Use the user_migration app A new way since the Nextcloud update to 24 is to use the new [user_migration app](https://apps.nextcloud.com/apps/user_migration#app-gallery). It allows to export the most important data on one instance and import it on a different Nextcloud instance. For that, you need to install and enable the user_migration app on your old instance, trigger the export for the user, create the user on the new instance, log in with that user and import the archive that was created during the export. This then needs to be done for each user that you want to migrate. + +# Synchronising with clients after migration +#### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery +By default the Nextcloud server is considered the authorative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server. + +If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run the maintenance:data-fingerprint command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked. + +>[!Note] +>The usage of maintenance:data-fingerprint can cause conflict dialogues and difficulties deleting files on the client. Therefore it’s only recommended to prevent dataloss if the backup was outdated. + + +If you are running multiple application servers you will need to make sure the config files are synced between them so that the updated data-fingerprint is applied on all instances. From 782e949742426f6769505e273c1873e908b84608 Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 25 Oct 2023 07:49:49 -0700 Subject: [PATCH 2/4] Update migration.md Include proper command specific for Nextcloud AIO Signed-off-by: Lance --- migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration.md b/migration.md index 0cac55ce..11078c2d 100644 --- a/migration.md +++ b/migration.md @@ -91,7 +91,7 @@ A new way since the Nextcloud update to 24 is to use the new [user_migration app #### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery By default the Nextcloud server is considered the authorative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server. -If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run the maintenance:data-fingerprint command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked. +If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:data-fingerprint` command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked. >[!Note] >The usage of maintenance:data-fingerprint can cause conflict dialogues and difficulties deleting files on the client. Therefore it’s only recommended to prevent dataloss if the backup was outdated. From dadb57f74f4ee70a4d9755254e12ab0cbe75f453 Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 25 Oct 2023 23:07:42 -0700 Subject: [PATCH 3/4] Update migration.md, fix spelling Fix a spelling mistake Signed-off-by: Lance --- migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration.md b/migration.md index 11078c2d..382ec916 100644 --- a/migration.md +++ b/migration.md @@ -89,7 +89,7 @@ A new way since the Nextcloud update to 24 is to use the new [user_migration app # Synchronising with clients after migration #### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery -By default the Nextcloud server is considered the authorative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server. +By default the Nextcloud server is considered the authoritative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server. If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:data-fingerprint` command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked. From 7ffe4fbd5f0516faa3c11657d14fc9524fc54d88 Mon Sep 17 00:00:00 2001 From: Lance Date: Mon, 30 Oct 2023 06:52:07 -0700 Subject: [PATCH 4/4] Update migration.md, add links about synchronization Make it more obvious about the added note on synchronizing after migration Signed-off-by: Lance --- migration.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration.md b/migration.md index 382ec916..1574381c 100644 --- a/migration.md +++ b/migration.md @@ -18,6 +18,7 @@ The procedure for migrating only the files works like this: 1. Next, run `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chown -R 33:0 /mnt/ncdata/` and `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chmod -R 750 /mnt/ncdata/` to apply the correct permissions. (Or if `NEXTCLOUD_DATADIR` was provided, apply `chown -R 33:0` and `chmod -R 750` to the chosen path.) 1. Start the containers again and wait until all containers are running 1. Run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data && sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all` in order to scan all files in the datadirectory. +1. If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below. ## Migrate the files and the database **Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! Also, this will not work on former snap installations as the snap is read-only and thus you cannot install the necessary `pdo_pgsql` PHP extension. So if migrating from snap, you will need to use one of the other methods. However you could try to ask if the snaps maintainer could add this one small PHP extension to the snap here: https://github.com/nextcloud-snap/nextcloud-snap/issues which would allow for an easy migration. @@ -84,9 +85,13 @@ The procedure for migrating the files and the database works like this: Now the whole Nextcloud instance should work again.
If not, feel free to restore the AIO instance from backup and start at step 8 again. +If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below. + ## Use the user_migration app A new way since the Nextcloud update to 24 is to use the new [user_migration app](https://apps.nextcloud.com/apps/user_migration#app-gallery). It allows to export the most important data on one instance and import it on a different Nextcloud instance. For that, you need to install and enable the user_migration app on your old instance, trigger the export for the user, create the user on the new instance, log in with that user and import the archive that was created during the export. This then needs to be done for each user that you want to migrate. +If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below. + # Synchronising with clients after migration #### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery By default the Nextcloud server is considered the authoritative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server.