Browse Source

Document Nextcloud migration

DricomDragon 3 years ago
parent
commit
a80e82dd39
3 changed files with 63 additions and 10 deletions
  1. 6 0
      Guides/apt.md
  2. 2 2
      Guides/install-linux.md
  3. 55 8
      Guides/nextcloud.md

+ 6 - 0
Guides/apt.md

@@ -25,3 +25,9 @@ Kill the process owner.
 Erase the file.
 
 `sudo rm /var/lib/apt/lists/lock`
+
+## Get logs
+
+`sudo tail -f /var/log/apt/term.log`
+
+Can be used if SSH connection lost but upgrade still running in background.

+ 2 - 2
Guides/install-linux.md

@@ -33,9 +33,9 @@ Execute `deep-upgrade`, `basic-install` and `basic-custom` before any tweak.
 
 ### Hostname
 
-Change hostname with `sudoedit /etc/hostname`
+Need reboot : `sudoedit /etc/hostname`
 
-Reboot.
+No reboot required with *systemd* : `sudo hostname new-hostname`
 
 ### Tweaks
 

+ 55 - 8
Guides/nextcloud.md

@@ -6,7 +6,7 @@ Journey to install Nextcloud on an Ubuntu Server 20.04 LTS instance.
 
 Installed by checking _nexcloud_ on Ubuntu installation wizard. Can be installed later with **snap**.
 
-## Configure proxy
+### Configure proxy
 
 _Use case : ports 80 and 443 are directed to my raspberry pi (with local IP 192.168.1.100), and domain name cloud.me.ovh must be redirected to my nexcloud server on IP 192.168.1.110_
 
@@ -32,7 +32,7 @@ $CONFIG = [
 ];
 ```
 
-## Trust domain
+### Trust domain
 
 Add a file `trust_domain.config.php` in folder _/var/snap/nextcloud/current/nextcloud/config_ with following content :
 
@@ -52,29 +52,29 @@ $CONFIG = [
 
 No need to restart system, config is taken into account at web page reload.
 
-## Enforce security
+### Enforce security
 
-### On proxy
+#### On proxy
 
 Follow [official instructions on Nextcloud doc](https://docs.nextcloud.com/server/latest/admin_manual/installation/harden_server.html)
 
 To enable *mod_headers* on HTTPD : `a2enmod headers`
 
-### On snap installation
+#### On snap installation
 
 `sudo nextcloud.enable-https lets-encrypt`
 
-## Other fixes
+### Other fixes
 
 As an admin, go to _Overview_ in the _Administration_ panel from _Settings_. Nexctloud will scan your instance and give you instructions.
 
-## TURN Talk
+### TURN Talk
 
 Talk can fail for some users behind annoying firewalls or symmetric NAT.
 
 That can be fixed by using a [TURN server](https://nextcloud-talk.readthedocs.io/en/latest/TURN/).
 
-## Synchronisation on Android
+### Synchronisation on Android
 
 Follow these instructions [Nextcloud sync documentation](https://docs.nextcloud.com/server/20/user_manual/en/pim/sync_android.html).
 
@@ -114,3 +114,50 @@ Install via CLI with :
 ```
 sudo -u www-data php -d memory_limit=512M nextcloud.occ app:install richdocumentscode
 ```
+
+## Migrate to a new installation
+
+### References
+
+[Official Nextcloud guide to migrate from one server to another](https://docs.nextcloud.com/server/latest/admin_manual/maintenance/migrating.html)
+
+### Chronogram
+
+1. Change DNS record (anticipate propagation time)
+2. Make a fresh installation on a new server
+    21. Install OS
+    22. Set a unic hostname
+    23. Assign a static IP address
+    24. Update and reboot
+3. Backup old installation and import data on a new server
+    30. Stop services `sudo systemctl stop 'snap.nextcloud.*'`
+    31. Change ownership of `common` and `current` in `/var/snap/nextcloud` to SSH user on target
+    32. Transfer files these 2 folders on the new instance (be sure the same version is installed)
+    33. Restore folder ownership
+    34. Start services `sudo systemctl start 'snap.nextcloud.*'`
+4. Local test
+    41. Browser access
+    42. Files available
+5. Make your instance available 
+    51. Check DNS redirection
+    52. Set up reverse-proxy
+6. Online test
+    61. Browser access
+    62. Files available
+    63. PC sync client
+    64. Android sync client
+    65. Agenda sync
+    66. Tasks sync
+    67. Money buster sync
+
+### Switch to a reverse-proxy
+
+Disable HTTPS with `nextcloud.disable-https`
+
+Configure HTTPS on reverse-proxy.
+
+### Trouble shoot migration
+
+Apps are not working (example from my own migration : *Contacts* and *Tasks* not working because of javascript file not found.
+
+I had some errors after `rsync` about those files. That might be related.