Update Owncloud to Version 5.0

Yesterday I recognized that a new Version of Owncloud was released. I used it for a long time to synchronize my calendars and contacts between OSX and Linux machines. It was quite simple to install and quite simple to update, but they changed a lot of things in 5.0 so it is not just an rsync to update owncloud, but it is already quite easy. I will explain it to you. [TOC]

Owncloud - What is it?

ownCloud is a software suite that provides a location-independent storage area for data. The project was launched in January 2010 by KDE developer Frank Karlitschek to create a Free software alternative to commercial cloud providers. In contrast to commercial storage services, ownCloud can be installed on a private server at no additional cost. The project is based on PHP and a SQLite, MySQL, Oracle or PostgreSQL database, so ownCloud can run on all platforms that meet these requirements. ownCloud can be operated via a web interface and is thus not tied to a particular operating system. However, native applications, such as File Manager or Group Wares can interact with ownCloud via an interface and provide data and files locally.

How to update

Update: I got a lot of problems with updating owncloud to version 5.0. So I decided to do a new and strange way.

I installed owncloud via apt-get and moved all necessary content from my old sqlite3 db to the new one. This is not too difficult, because I just use owncloud to synchronize my calendar and my contacts.

backup old owncloud

I use tar to backup my old owncloud directory.

tar cfvz /var/www/owncloud-backup.tar.gz /var/www/owncloud

Now, I take the old database located at /var/www/owncloud/data/.

mv /var/www/owncloud/data/owncloud.db /tmp/old-owncloud.db

Install new owncloud from packaging system

First of all, we need the Release-key of the repository:

cd /tmp/
    wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/Release.key
    apt-key add - < Release.key

Now add the debian repository to your sources list.

echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/ /' >> /etc/apt/sources.list.d/owncloud.list

Now we can get owncloud via apt-get

apt-get update
    apt-get install owncloud

move database content

Here are the steps I have done to update:

  • move old database next to the new one:
mv /mnt/old-owncloud.db /var/www/owncloud/data/
  • move to directory:
cd /var/www/owncloud/data
  • get sqlite3 prompt:
  • attach both databases:
attach database 'owncloud.db' as e1;
        attach database 'old-owncloud.db' as e2;
  • delete the content of two tables:
delete from e1.oc_calendar_objects;
        delete from e1.oc_calendar_calendars;
  • insert old content of calendar and contacts into new database:
insert into e1.oc_calendar_objects select * from e2.oc_calendar_objects;
        insert into e1.oc_calendar_calendars select * from e2.oc_calendar_calendars;
        insert into e1.oc_contacts_cards select * from e2.oc_contacts_cards;
comments powered by Disqus