4ps4all's picture

hi, I managed to upgrade the nextcloud appliance. I added some example command I used to the guide for the manual upgrade.

https://docs.nextcloud.com/server/11/admin_manual/maintenance/manual_upg...

Option 1

was not working, the command error was:

Nextcloud is allready latest version

Option 3 I didn't tested it.

 

Upgrade Manually

Always start by making a fresh backup and disabling all 3rd party apps.

  1. Back up your existing Nextcloud Server database, data directory, and config.php file. (See Backup, for restore information see Restoring Backup)

  2. Download and unpack the latest Nextcloud Server release (Archive file) from nextcloud.com/install/ into an empty directory outside of your current installation.

    Note

    To unpack your new tarball, run: unzip nextcloud-[version].zip

    To copy the file nextcloud-[version].zip you can use

#scp filetocopy root@NextcloudContainerIP:\directory

  1. Stop your Web server.

    HOW TO STOP APACHE AND TO VERIFY IT’S STOPPED

    this command seems to work

    #apachectl stop

    this command doesn’t work

    #apache2ctl status

    /usr/sbin/apache2ctl: 101: /usr/sbin/apache2ctl: www-browser: not found 'www-browser -dump http://localhost:80/server-status' failed. Maybe you need to install a package providing www-browser or you need to adjust the APACHE_LYNX variable in /etc/apache2/envvars

     

  2. Rename your current Nextcloud directory, for example nextcloud-old.

    #mv /usr/share/nextcloud /usr/share/nextcloud/old

  3. Unpacking the new archive creates a new nextcloud directory populated with your new server files. Copy this directory and its contents to the original location of your old server, for example /var/www/, so that once again you have /var/www/nextcloud.

    #unzip nextcloud-[version].zip

    #mv /NewunzippedNextcloudVersione /usr/share/nextcloud

  4. Copy the config.php file from your old Nextcloud directory to your new Nextcloud directory.

    #cp /usr/share/nextcloud-old/config/config.php /usr/share/nextcloud/config/

  5. If you keep your data/ directory in your nextcloud/ directory, copy it from your old version of Nextcloud to your new nextcloud/. If you keep it outside of nextcloud/ then you don’t have to do anything with it, because its location is configured in your original config.php, and none of the upgrade steps touch it.

    #cp -r /usr/share/nextcloud-old/data /usr/share/nextcloud/data

    Note: if you’re using a VirtualMachine/Container and your /data folder is not in another virtualdisk, or external disk, you must be sure to have enough space to copy all the /data folder. After the upgrade do I have to delete the old /Data directory ??

     

  6. If you are using 3rd party applications, look in your new nextcloud/apps/ directory to see if they are there. If not, copy them from your old apps/ directory to your new one. Make sure the directory permissions of your third party application directories are the same as for the other ones.

    #cp -r /usr/share/nextcloud/apps/Name_of_theAPP /usr/share/nextxloud/apps

    (Name of the 3rd party app can be calendar,contacts,deck,music,notes if you were using that apps)

  7. Adjust file ownership and permissions:

    chown -R www-data:www-data nextcloud-main-directory 
    find nextcloud/ -type d -exec chmod 750 {} \;
    find nextcloud/ -type f -exec chmod 640 {} \;
    #chown -R www-data:www-data /usr/share/nextcloud
    #find nextcloud/ -type d -exec chmod 750 {} \;
    #find nextcloud/ -type f -exec chmod 640 {} \;
  8. Restart your Web server.

    #apachectl start

  9. Now launch the upgrade from the command line using occ, like this example

OPTION 2

su - -s /bin/bash  www-data -c 'php /usr/share/nextcloud/occ upgrade'
	IT WORKED to upgrade from 11.0.1 to 12.0.3
  1. The upgrade operation takes a few minutes to a few hours, depending on the size of your installation. When it is finished you will see a success message, or an error message that will tell where it went wrong.

Login and take a look at the bottom of your Admin page to verify the version number. Check your other settings to make sure they’re correct. Go to the Apps page and review the core apps to make sure the right ones are enabled. Re-enable your third-party apps.