Migrating from ownCloud to Nextcloud

So I should be able to update the website to Nextcloud with minimal issues and the clients will pick up the new site even if I donā€™t change it to the Nextcloud client (yet)?

I plan on converting it all to Nextcloud but need to do it with minimal interruption.

That is the expected behaviour and how it should and does work, yes. If it causes any problems please file an issue :slight_smile

Is it possible to install nextcloud with package manager (apt-get) and do manual migration?

we have no packages yet - not sure if that comes, see above - we donā€™t plan on doing it ourselves as that has been too troublesome in the past.

1 Like

Hello,

migration to nc worked here without problems from OC 9.0.2 under ubuntu 14.04 lts on odroid xu4 :slight_smile:

Thanks for your hard work!

Until migration I used the package manager to update with apt-get.
Is it save to remove it now and if yes, how?

Ciao,
Joachim

In case of package install, like apt-get on debian based distrib, how do I make sure there wonā€™t be any conflict in the future?
Can I remove the package first and do the manual migration?

$ apt remove owncloud
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
The following packages were automatically installed and are no longer required:
libapache2-mod-php5 libicu52 libmcrypt4 libpq5 owncloud-deps-php5
owncloud-files php-pear php-xml-parser php5 php5-cli php5-curl php5-gd
php5-intl php5-mcrypt php5-mysqlnd php5-pgsql php5-readline php5-sqlite
Use ā€˜apt-get autoremoveā€™ to remove them.
The following packages will be REMOVED:
owncloud
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 25.6 kB disk space will be freed.
Do you want to continue? [Y/n]

Yes you can remove owncloud package (iā€™ve done it) BUT :

Evidently, DONā€™T do an ā€œautoremoveā€ ! You need these packages. (Dependencies).

2 Likes

Hmm, if you used the ownCloud provided packages it is best to save the config files and the nextcloud folder itself before you move over. The ā€˜normalā€™ packages (not owncloud-files) installs something in the etc/apache folder: etc/apache2/conf-available/owncloud.conf - might be good to have a look at what that is and how it helps :wink:

Otherwise, save the nextcloud folder and you should be good.

1 Like

Hello,

removed it with
$ apt remove owncloud
after migrating to nextcloud under ubuntu 14.04 lts. No issues.

Thanks to @Akhenaton and @coolnodje and @jospoortvliet !

Ciao,
Joachim

4 Likes

That means i never can do an ā€œautoremoveā€ in the future. What about apt-get dist-upgrade? Isnā€™t that removing packages.

Or is there a way to remove oc with all dependencies and reinstall nextcloud. But what dependencies then to install. What about the configuratin aof them (mysgl, apache for example)

Isnā€™t there a clean way to switch to nextcloud? Do i have to remove the owncoud.lists from apt?

1 Like

I suggest you to do a ā€œman apt-markā€

Tip: Use the command apt-mark showmanual to see what is currently marked as manual on your system.
Tip: Use the command sudo apt-mark [auto | manual] to change a packageā€™s (or list of packages) marking

If you mark the packages ā€œmanualā€ it will be preserved and never removed by an ā€œautoremoveā€ (as if it has been installed by you and not by dependencies)

3 Likes

Hmm, Iā€™m not too sure whether I am capturing this thread now, as the discussion took it elsewhere. Alas, the thread title is just too suiting not to :stuck_out_tongue:

Speaking of "Migrating from OC to NCā€¦

In another thread (Why?), one can learn about the decision being difficult for end users whether to upgrade now or later etc.pp.:

My suggestion to aid these users, who havenā€™t or even cannot decide(d) yet, simply because there is too much work and/or customers and talking involved:

Keep NC 9.050 available as well as the migration path from here on (aka major versions to come). This would probably help some users to stick with OC 9 for now and to sit and wait what the future brings for both projects. When they finally learn that NC is the better choice for them (which, of course, they will undoubtly do :stuck_out_tongue: ), easy migration is still at hand.

As a second step (in case you guys get bored gg), you could offer something like a ā€œmigration packā€ ā€¦ whatever this may require or look like .

Just my 0,02ā‚¬

John

2 Likes

Yes please!

Iā€™d like to see how things develop a little first, rather than getting backed into a corner of ā€˜switch now, or youā€™ll never be able toā€™.

2 Likes

Iā€™ve successfully upgraded from OC8.2 to NC9 using the method described, yay!
Edit: Below is resolved, missing file.
Security log shows an integrity warning about a .htaccess file, donā€™t think itā€™s relevant as Iā€™m using nginx, which does not use those.
Is nginx supported by nextcloud?

1 Like

Iā€™m also migrated from OC to NextCloud successfully!
It working good overall.

However, the ClamAV still not working as before in OC.
It giving me errors.
Hope you guys fix it soon.

Thanks for the NextCloud.

1 Like

That is ABSOLUTELY what we want to enable - even recommend. Weā€™re totally confident that half a year from now, things will be entirely clear. Perhaps sooner, even. So sit back, watch, we will take care of providing a clean migration path for sure.

From a security point of view, well, @LukasReschke works for us so if youā€™re very security conscious I can recommend to move to Nextcloud, same with if you need the features. But we will report security issues back upstream, anything else would be very uncool, so while they might be slower to release you wonā€™t be super insecure. If you donā€™t care too much about either of these then stay put and we can help you migrate later. No worries.

Upgraded from OC 9 running on CentOS 7 with the following steps and zero issues ( I am using apache instead of nginx, but change what would be needed for nginx if needed.

download the zip file and unzip it into your www location of wherever apache nginx is looking at
copy over owncloud/data and owncloud/config to the nextcloud directory.
run the upgrade "sudo -u apache php occ upgrade"
run a chown -R apache:apache on the nextcloud directory
configure apache nginx to point to your nextcloud directory instead of the owncloud one

Not needed but if you use the news application then you need to go to php5.6
assume you already have php 5.5 this step could be not needed
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum install yum-plugin-replace

yum replace php55w-common --replace-with=php56w-common

Start apache back up
systemctl restart httpd

Enjoy

1 Like

In case it helps others, here are my notes from manually migrating my server from ownCloud 9.0.2 to Nextcloud 9.0.50. Follow this at your own risk and keep in mind these commands are specific to my environment, install locations, etc. so adjust for your setup accordingly. I also recommend testing/reviewing backups before upgrading to make sure your data is safe and you have a way to recover.

Iā€™ve got a manual install on a LEMP stack. My setup consists of:

  • Ubuntu 16.04 LTS
  • NGINX 1.11.1
  • PHP 7.0.4-7ubuntu2.1 (cli) ( NTS )
  • MariaDB 10.1.13

Backup Everything

Reference: https://doc.owncloud.org/server/9.0/admin_manual/maintenance/backup.html

Enable Maintenance Mode

sudo -u www-data php /var/www/html/cloud.lan/occ maintenance:mode --on

Backup Folders

mkdir -p ~/Documents/backup/

sudo rsync -Aax /var/www/html/cloud.lan ~/Documents/backup/owncloud-web-dirbkp_`date +"%Y%m%d"`/
sudo rsync -Aax /var/oc_data/ ~/Documents/backup/owncloud-oc_data-dirbkp_`date +"%Y%m%d"`/

Backup Database

mysqldump --lock-tables -u vance -p owncloud > ~/Documents/backup/owncloud-sqlbkp_date +"%Y%m%d".bak

Download & Verify Source of New Release

sudo curl -L https://download.nextcloud.com/server/releases/nextcloud-9.0.50.tar.bz2 -o /usr/local/src/nextcloud-9.0.50.tar.bz2

sudo curl -L https://download.nextcloud.com/server/releases/nextcloud-9.0.50.tar.bz2.sha256 -o /usr/local/src/nextcloud-9.0.50.tar.bz2.sha256

cat /usr/local/src/nextcloud-9.0.50.tar.bz2.sha256

echo "6c067d01416462dffb80862468a3f1b43307e48b9f8f023d544875dfa5db2ddf /usr/local/src/nextcloud-9.0.50.tar.bz2" | sha256sum -c -

sudo curl -L https://download.nextcloud.com/server/releases/nextcloud-9.0.50.tar.bz2.asc -o /usr/local/src/nextcloud-9.0.50.tar.bz2.asc

curl -L https://nextcloud.com/nextcloud.asc -o nextcloud.asc

gpg --import nextcloud.asc

rm nextcloud.asc

gpg --verify /usr/local/src/nextcloud-9.0.50.tar.bz2.asc /usr/local/src/nextcloud-9.0.50.tar.bz2

Start Installation

Unzip

cd /usr/local/src/

sudo tar -xjf /usr/local/src/nextcloud-9.0.50.tar.bz2

Stop Web Server

sudo kill -QUIT $( cat /var/run/nginx.pid )

Rename old ownCloud directory

sudo mv /var/www/html/cloud.lan /var/www/html/cloud.lan.old

Move new source code into place

sudo cp -r /usr/local/src/nextcloud /var/www/html/cloud.lan

Restore old config

sudo cp /var/www/html/cloud.lan.old/config/config.php /var/www/html/cloud.lan/config/config.php

If you keep your data/ directory in your owncloud/ directory, copy it from your old version of ownCloud to your new owncloud/. If you keep it outside of owncloud/ 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.

If you are using 3rd party applications, look in your new owncloud/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.

Restart NGINX

sudo nginx

Resolve permissions

sudo chown --recursive www-data:www-data /var/www/html/cloud.lan

Start upgrade
sudo -u www-data php /var/www/html/cloud.lan/occ upgrade

I encountered an error about ā€œPHP module mb multibyte not installed.ā€
sudo apt-get update && sudo apt-get install php7.0-mbstring

Re-start upgrade

sudo -u www-data php /var/www/html/cloud.lan/occ upgrade

Secure permissions

cd /usr/local/bin

sudo cp set-owncloud-permissions.sh set-nextcloud-permissions.sh

Reference: https://docs.nextcloud.org/server/9/admin_manual/installation/installation_wizard.html#strong-perms-label for ideas on how to write a permissions setting script. Mine is below:

#!/bin/bash
ocpath='/var/www/html/cloud.lan'
ocdata='/var/oc_data'
htuser='www-data'
htgroup='www-data'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ocdata
mkdir -p $ocpath/assets

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
find ${ocdata}/ -type f -print0 | xargs -0 chmod 0640
find ${ocdata}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocdata}/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
 then
  chmod 0644 ${ocpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocdata}/.htaccess ]
 then
  chmod 0644 ${ocdata}/.htaccess
  chown ${rootuser}:${htgroup} ${ocdata}/.htaccess
fi

sudo ./set-nextcloud-permissions.sh

Disable Maintenance Mode

sudo -u www-data php /var/www/html/cloud.lan/occ maintenance:mode --off

Login as Admin and Check for warnings. If all is good, feel free to clean up downloads, etc.

8 Likes

That is awesome. Now I feel my blog I just published isnā€™t half as good as it should beā€¦

I will update it to point to this awesome post!

1 Like

Can you elaborate what the problem with distribution packages was/is?
Iā€™ve previously used the packages from here for Debian 7/8 and Ubuntu and it generally worked very well.

Distributions picking up nextcloud wouldnā€™t get you any up to date software anyway (at least not in the Debain/Ubuntu case).
Archlinux already has a PKGBUILD in the AUR. Hope it gets promoted to community at some time.