diff --git a/.github/scripts/tc-lint.sh b/.github/scripts/tc-lint.sh index 61cd4b5de99..ae3f10fe281 100755 --- a/.github/scripts/tc-lint.sh +++ b/.github/scripts/tc-lint.sh @@ -8,6 +8,7 @@ function check_version() { # git diff target_branch, filter only on $chart_path and invert match for $chart_path/docs # note that it requires branches to be up to date for this to work. chart_changes=$(git diff --name-status "$target_branch" -- "$chart_path" | grep -v "$chart_path/docs") + echo -e "\tChange files: \n\n$chart_changes" if [[ -z "$chart_changes" ]]; then echo -e "\tLooks like only docs changed. Skipping chart version check" diff --git a/charts/incubator/nextcloud/docs/img/nextcloud-cli.png b/charts/incubator/nextcloud/docs/img/nextcloud-cli.png new file mode 100644 index 00000000000..165a3a5987d Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/nextcloud-cli.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-backup.png b/charts/incubator/nextcloud/docs/img/pgadmin-backup.png new file mode 100644 index 00000000000..a823f2a1038 Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-backup.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-connection1.png b/charts/incubator/nextcloud/docs/img/pgadmin-connection1.png new file mode 100644 index 00000000000..050c2d637bd Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-connection1.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-connection2.png b/charts/incubator/nextcloud/docs/img/pgadmin-connection2.png new file mode 100644 index 00000000000..db474d7085e Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-connection2.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-restore1.png b/charts/incubator/nextcloud/docs/img/pgadmin-restore1.png new file mode 100644 index 00000000000..e99ba0141b1 Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-restore1.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-restore2.png b/charts/incubator/nextcloud/docs/img/pgadmin-restore2.png new file mode 100644 index 00000000000..aac7b82259e Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-restore2.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-restore3.png b/charts/incubator/nextcloud/docs/img/pgadmin-restore3.png new file mode 100644 index 00000000000..ce8cf841355 Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-restore3.png differ diff --git a/charts/incubator/nextcloud/docs/img/pgadmin-restore4.png b/charts/incubator/nextcloud/docs/img/pgadmin-restore4.png new file mode 100644 index 00000000000..a1bbe152ffe Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/pgadmin-restore4.png differ diff --git a/charts/incubator/nextcloud/docs/img/tcdbinfo-output.png b/charts/incubator/nextcloud/docs/img/tcdbinfo-output.png new file mode 100644 index 00000000000..923d09edf4b Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/tcdbinfo-output.png differ diff --git a/charts/incubator/nextcloud/docs/img/userdata-clean.png b/charts/incubator/nextcloud/docs/img/userdata-clean.png new file mode 100644 index 00000000000..5e5c979d998 Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/userdata-clean.png differ diff --git a/charts/incubator/nextcloud/docs/img/userdata-old.png b/charts/incubator/nextcloud/docs/img/userdata-old.png new file mode 100644 index 00000000000..fb9224d8a4e Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/userdata-old.png differ diff --git a/charts/incubator/nextcloud/docs/img/userdata-perms.png b/charts/incubator/nextcloud/docs/img/userdata-perms.png new file mode 100644 index 00000000000..4353c68cde6 Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/userdata-perms.png differ diff --git a/charts/incubator/nextcloud/docs/img/userdata-setting.png b/charts/incubator/nextcloud/docs/img/userdata-setting.png new file mode 100644 index 00000000000..886cdeefd2c Binary files /dev/null and b/charts/incubator/nextcloud/docs/img/userdata-setting.png differ diff --git a/charts/incubator/nextcloud/docs/migration-guide.md b/charts/incubator/nextcloud/docs/migration-guide.md new file mode 100644 index 00000000000..b482bdf75dd --- /dev/null +++ b/charts/incubator/nextcloud/docs/migration-guide.md @@ -0,0 +1,164 @@ +# Nextcloud Migration Guide + +This guide will walk you through the migration process for Nextcloud. This guide utilize HostPath or NFS for UserData. + +:::danger TWO FACTOR AUTHENTICATION + +If you are using two factor authentication on your Nextcloud accounts disable it before starting this guide. While it can be done via the CLI later it is much easier to disable it before hand. + +::: + +## Backup Nextcloud Database + +If you have not already done so install PGAdmin and the [tcdbinfo.sh script](https://truecharts.org/manual/SCALE/guides/sql-export#how-to-list-database-login-info-for-truecharts-apps) + +1. Run the tcdbinfo.sh script and take note of the connection info + +```bash +bash tcdbinfo.sh +``` + +![tcdbinfo-output](./img/tcdbinfo-output.png) + +2. Add Nextcloud to PGAdmin using the connection info from previous step. + +![pgadmin-connection1](./img/pgadmin-connection1.png) +![pgadmin-connection2](./img/pgadmin-connection2.png) + +3. Backup Nextcloud database. + +![pgadmin-backup](./img/pgadmin-backup.png) + +## Delete Nextcloud + +:::danger Userdata Location + +Do not remove your Nextcloud installation until you have confirmed you use HostPath/NFS for user data or have copied UserData using utilizing [Heavyscript](https://github.com/Heavybullets8/heavy_script) + +::: + +If you are using HostPath of NFS for UserData then remove your current Nextcloud installation. If you are using PVC for UserData then you will first need to mount your Nextcloud PVC and copy your UserData to a new dataset. + +## Remove Old Nextcloud AppData + +This step is not required but to have a clean installation remove all UserData folder and files that are not user folders. + +```bash +ls -la +``` + +![userdata-old](./img/userdata-old.png) + +:::warning + +Next steps are destructive without a way to undo. +Make sure you have proper backups to avoid data loss. + +You have been **warned** + +```bash +rm -rf +``` + +```bash +rm .ocdata .htaccess index.html nextcloud.log +``` + +![userdata-clean](./img/userdata-clean.png) + +::: + +## Change UserData Permissions + +The new version of Nextcloud uses apps instead of www-data for file ownership. Apply permissions as shown below to your UserData dataset. + +![userdata-perms](./img/userdata-perms.png) + +## Install Nextcloud + +Install with a temporary user that you do not currently use for Nextcloud (ie. temp) + +Setup Nextcloud UserData storage with your previous UserData dataset or the dataset you copied your UserData to. + +![userdata-setting](./img/userdata-setting.png) + +## Restore Nextcloud Database + +:::caution Nextcloud Installation + +Wait for Nextcloud to fully deploy before proceeding. + +::: + +1. Stop the main pod of Nextcloud. + +```bash +k3s kubectl scale deploy nextcloud -n ix-nextcloud --replicas=0 +``` + +2. Add Nextcloud to PGAdmin as guided in [steps 1 and 2 here](#backup-nextcloud-database). + +3. In PGAdmin right click on the database and select restore as shown below. + +![pgadmin-restore1](./img/pgadmin-restore1.png) + +4. Select the database backup you created previously. + +![pgadmin-restore2](./img/pgadmin-restore2.png) + +5. Configure Data/Objects as shown below. + +![pgadmin-restore3](./img/pgadmin-restore3.png) + +6. Configure Options as shown below and click restore. + +![pgadmin-restore4](./img/pgadmin-restore4.png) + +:::caution PGAdmin Error + +PGAdmin may display an error during the restore process. This is known to occur and may be ignored. + +::: + +7. Start the main pod of Nextcloud. + +```bash +k3s kubectl scale deploy nextcloud -n ix-nextcloud --replicas=1 +``` + +## Nextcloud OCC Commands + +:::caution Nextcloud Deploy + +Wait for Nextcloud to fully deploy before proceeding. + +::: + +1. Open a shell for the Nextcloud main pod as shown below. Ensure your are selecting the correct pod it should just say nextcloud for both Pods (followed by random characters only) and Containers as shown below. + +![nextcloud-cli](./img/nextcloud-cli.png) + +2. Run the following commands in the Nextcloud shell. + +```bash +occ upgrade +``` +```bash +occ maintenance:mode --on +``` +```bash +occ maintenance:repair +``` +```bash +occ maintenance:mode --off +``` +```bash +occ db:add-missing-indices +``` +```bash +occ files:scan --all +``` + +## Delete Temporary User Data Folder + +You may now remove the folder created during install for the temporary user that was configured.