Is your Nextcloud still setup under the default owncloud-path (/var/www/owncloud)? I’m not 100% sure about the apt-routing, normally only program data is removed but no user data. But you manually replaced the code so it’s not sure what will happen. In that case, I would do a full backup of this folder. Then remove the owncloud packages and if something is deleted, you can restore it from your backup.