The other day the internal disk of my old laptop had enough. That laptop was a very old one which I was using connected to my TV for common daily (non-working) activities. I decided to replace it with a little form factor barebone. During this week I have been re-installing all my stuff in the new box and, among other things, my owncloud should be configured. I have to say that I am quite disappointed with the current status of the software. I had the application installed using the Debian packages in the broken box and, from time to time, I saw an upgrade. And everything was perfectly smooth as it usually is in this distribution (even in the testing branch where I am). But this week I realized the following nasty things:
The owncloud package is no more in the Debian repository (see this email which links to another one in Fedora which is incredibly revealing). So I was forced to change from Debian package to manual installation.
Then I received the surprise that owncloud needs to be upgraded major version by major version (skipping major releases is not supported). I was in 7.0.x (the last version that Debian provided), so I have to finish at 9.0.x going through 8.0.x, 8.1.x and 8.2.x.
Performing the manual upgrade my second surprise was that some applications are disabled after the upgrade (you have to manually enable them after that). In my case there were mainly calendar, contacts and notes (the only one that is experimental and added explicitly). If you do not enable an application, and it needs some upgrade, the upgrade is not done and maybe the app fails later in the next major release when you finally enable it. I painfully learned this point.
- Finally I could not go to the last version 9.0.x because some problems in the upgrade. I decided to relax and wait some time with version 8.2.4.2. If I finally have to delete all the fucking affected tables and manually re-insert the rows one by one I will seriously consider to change my synchronization software.
Hey owncloud guys! This is a bit insane, isn't it? I use a distribution because the incredible job of a bunch of guys permits me (and millions of other people) to use your software seamlessly. Sometimes Debian is quite radical but, if Fedora maintainer also followed the same path before, maybe you have to reconsider your position.
Owncloud offers its own repository for several distributions (Debian among them). This way almost all the pain I am commenting here disappears, because, again, the software is automatically upgraded version by version (almost because of the notes experimental app). But I have some problems with this approach. First of all, I trust much more on Debian than in owncloud (sorry guys) and, second, I need to start with the last version which I cannot install because of the bug in the database upgrade. Personally I do not like this way and I suspect that this is exactly what owncloud wants me to do after getting rid of the distributions. (Yeah! I know I am fucking screwy.)
In general the installation of my previous data (backed up from my old laptop) to the new box, and the later upgrade to a recent owncloud version was a nightmare. I am going to summary the upgrading process just for the next time I need it.
First do a proper backup of your version data (in my case I have a cron script that already perform this point). The database, config and data directories should be backed up.
cp ${OWNCLOUD_HOME}/config/config.php ${BACKUP_DIR}/config.php
tar zpcvf ${BACKUP_DIR}/data.rgz ${OWNCLOUD_HOME}/data
mysqldump -u root -p owncloud > ${BACKUP_DIR}/owncloud-bbdd.dump
Stop your apache server to perform the upgrade to the next major version.
systemctl stop apache2
Download the next major version (it should be the last minor version for the next mayor version). I decided to use a link (in /var/www directory) between versions to not change apache configuration. The link is used to maintain previous version intact.
cd /var/www
rm owncloud # delete the current link
wget https://download.owncloud.org/community/owncloud-X.X.X.zip
unzip owncloud-X.X.X.zip
mv owncloud owncloud-X.X.X
ln -s owncloud-X.X.X owncloud
Copy from the previous version the directories previously saved (Y.Y.Y is the old version, you can also use the backup files if you want).
cd owncloud
cp ../owncloud-Y.Y.Y/config.php config/config.php
cp -r ../owncloud-Y.Y.Y/data data
chown www-data:www-data config/config.php
chown -R www-data:www-data data
This is a custom point for mi case. The notes app is experimental and not distributed by the common bundle. So it should be added manually to the new version. The important point here is that you have to download a proper version of the app for the current major version of owncloud. There is no magic here, I decided the version of the notes app just reading the release comments. The notes app releases can be downloaded from here.
cd apps
wget https://github.com/owncloud/notes/releases/download/.../notes-X.X.X.tar.gz
tar zxvf notes-X.X.X.tar.gz
mv notes-X.X.X notes
Start the apache server again in order to perform the automatic upgrade.
systemctl start apache2
As soon as you enter in the owncloud URL it detects the mismatch with the ddbb version and starts the upgrade. So go to the login page and upgrade the software.
As I commented before, some applications are disabled during the upgrade, once the software is ready login into the application and enable your previously activated apps. In my case:
When the application is enabled it also detects there have been a version change and the data (database mainly) is upgraded if necessary.
Now your owncloud is at the next major version, please check that all your data is in place and everything works fine (you see your events, contacts, pictures and so on). If so jump again to step (1) to upgrade to the next major version until you are at the last current one. And remember, the first step is the backup, do not forget this.
Today's entry is a little summary for a manual multi-major version upgrade of an owncloud installation. Like other posts in the blog it is intended mainly for me, but maybe some of you can take advantage of the information.
Regards!
Comments