Migration Owncloud Nextcloud

Re-salut,

NextCloud tourne bien depuis la migration depuis Owncloud il y a 3 semaines, merci :slight_smile: je viens de tenter ma première mise à jour (bien qu’il n’y ait pas eu de nouvelle version depuis, juste pour voir si tout se passe bien) mais tout ne se passe pas comme prévu :

  1. il semble que NextCloud fasse toujours référence à un package ‘owncloud-deps’ que le processus d’upgrade n’arrive pas à trouver. Il y a un problème similaire sur ce post
    [Nextcloud] Echec de la mise à jour expliqué par @Siklaris et résolu avec l’aide de @JimboJoe. J’ai essayé sans succès d’appliquer la solution avec “equivs-control nextcloud-deps” (le message d’erreur reste le même)

root@ma-machine:/tmp# yunohost tools upgrade
Warning: Upgrading app jirafeau…
Warning: Upgrading app nextcloud…
Warning: dpkg-query: package ‘owncloud-deps’ is not installed and no information is available
Warning: Use dpkg --info (= dpkg-deb --info) to examine archive files,
Warning: and dpkg --contents (= dpkg-deb --contents) to list their contents.
Warning: Unable to back up the app ‘nextcloud’
Warning: There is nothing to save
Warning: Backup failed, the upgrade process was aborted.
Error: Unable to upgrade nextcloud
Warning: Upgrading app opensondage…
Warning: Upgrading app owncloud…
Warning: You must provide a URL to upgrade your custom app owncloud
Warning: Upgrading app wallabag2…
Warning: Upgrading app zerobin…
Warning: unable to upgrade apps: [Errno 61] No app to upgrade

  1. l’application OwnCloud est toujours installée avec la même URL d’accès (/owncloud) qui est également celle par défaut de NextCloud lorsque le script de migration est appliqué. Je voudrais supprimer l’app OwnCloud mais est-ce que je risque de casser quelque chose ?

Pour rappel j’avais eu quelque soucis ci-dessus lors de la migration et avait finalement fait l’upgrade depuis la branche testing. Je me demande si c’est au niveau du script de post-migration qu’il y a eu souçi. Et ne n’arrive plus à retrouver ce “owncloud_post_migration.sh” dans le dépôt Github.

Merci d’avance pour votre aide !

The owncloud_post_migration.sh script is located here.
In your case, it seems like the current nextcloud backup script isn’t up-to-date and wants to deal with the dep package.
Could you please dump the backup script somewhere (it’s location here: /etc/yunohost/apps/nextcloud/scripts/backup) in order for us to look at it? Is there any occurrence of dpkg in it?

Thank you for your answer. It seems that there is an occurence of dpkg and owncloud at the last line :

root@ma-machine:/tmp# cat /etc/yunohost/apps/nextcloud/scripts/backup
#!/bin/bash

set -eu

# Get multi-instances specific variables
app=$YNH_APP_INSTANCE_NAME

# Set app specific variables
dbname=$app
dbuser=$app

# Source app helpers
. /usr/share/yunohost/helpers

# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)

# Copy the app source files
DESTDIR="/var/www/$app"
ynh_backup "$DESTDIR" "www"

# Copy the data directory
DATADIR="/home/yunohost.app/${app}/data"
ynh_backup "$DATADIR" "data" 1

# Copy the conf files
mkdir ./conf
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "conf/nginx.conf"
ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "conf/php-fpm.conf"
ynh_backup "/etc/cron.d/${app}" "conf/cron"

# Dump the database
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql

# Copy the control file of the dependency package
# FIXME: find a way to retrieve package name from _common.sh?
dpkg-query -s owncloud-deps > ./owncloud-deps.control

Do you think I should re-execute the post_migration script ? I’m not sure anymore that I’ve given the old_app and new_app arguments when I run manually this script last time …

What it shows is that your app scripts (in /etc/yunohost/apps/nextcloud) are the old ones…
And re-launching the migration script will only clean the old ones (normally in /etc/yunohost/apps/owncloud) and remove the old owncloud application… but that may be a good start.

Nice ! It’s done :slight_smile: thank you @JimboJoe.
I just got some warnings during upgrade, don’t know if it’s a real problem …

  1. Execute manually the owncloud_post_migration.sh script : just execute each command line replacing old_app and new_app respectively by owncloud and nextcloud (don’t know why but the hooks were already moved)
  2. Get the new scripts in /etc/yunohost/apps/nextcloud/scripts/

cd /etc/yunohost/apps/nextcloud/
cp -R scripts/ old_scripts
rm -rf scripts/* && cd scripts
git clone GitHub - YunoHost-Apps/nextcloud_ynh: Nextcloud package for YunoHost
mv nextcloud_ynh/scripts/* ./
rm -Rf nextcloud_ynh/

  1. Upgrade with yunohost tools upgrade

Warning: Upgrading app jirafeau…
Warning: Upgrading app nextcloud…
Warning: Data dir will not be saved, because backup_core_only is set.
Warning: dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
Warning: Note that if you’ve installed some third-parties Nextcloud applications, they are probably disabled and you’ll have to manually enable them again.
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
> Success! nextcloud has been upgraded
Warning: Upgrading app opensondage…
Warning: Upgrading app wallabag2…
Warning: Upgrading app zerobin…
Success! The SSOwat configuration has been generated
Success! Upgrade complete
Success! The system has been upgraded

1 Like

Salut,

Ayant eu à refaire une migration sur une autre instance de Yunohost hébergée chez Gandi, et ayant rencontré les mêmes problèmes, voilà finalement les grandes étapes ci-dessous, ça sera peut être utile à quelqu’un d’autre. Et merci pour ce fix sur le script de migration Upgrade from an old version fails because the patches can’t be applicated :slight_smile:

apt-get update && apt-get dist-upgrade
yunohost tools upgrade

  • prévoir le bug [1] en supprimant la ligne “memcache.locking”: “\OC\Memcache\APC” de /var/www/owncloud/config/config.php
  • s’assurer que le paquet at est bien installé

at-get install at

  • lancer la migration (à la fin attendre 5min que la tâche cron en arrière plan tourne)

yunohost app upgrade -u GitHub - YunoHost-Apps/nextcloud_ynh: Nextcloud package for YunoHost owncloud --verbose

  • tenter une mise à jour des applications pour s’assurer que tout va bien (si le bug décrit ici [2] apparait, regarder le point n°2 de ce post [3])

yunohost tools upgrade

[1] Upgrade to Nextcloud 12.0 fails: "PHP Fatal error: Class '\OC\Memcache\APC' not found in /var/www/nextcloud/lib/private/Memcache/Factory.php on line 116" · Issue #50 · YunoHost-Apps/nextcloud_ynh · GitHub
[2] Migration Owncloud Nextcloud - #21 by lops
[3] Migration Owncloud Nextcloud - #25 by lops