Showing posts with label caldav. Show all posts
Showing posts with label caldav. Show all posts

Sunday, April 27, 2014

owncloud 5->6 migration

You had some old owncloud VM kicking around for awhile.  You want to save the data but trash the VM and start over - you're not sure how you installed owncloud any more and you just don't want to deal with old VM baggage.  Or maybe your VM took a shit and all you have are the data and config files from the old release.

Either way, here's how to take some old owncloud 5 data files and get them operational with a new owncloud 6 install on debian jessie:

(From here on out our backups are assumed to be in the directory in the $ocbak variable.  Before running these commands just export that to be your actual backup location:

slice@own $ export ocbak='/mnt/ocbak'

Note also that you may be able to omit some of these steps, but this is the way I did it and it worked.

Also note that this guide doesn't cover apache config at all; a standard owncloud config should work fine, and make sure everything under /var/www can be served.)

Installation the first

First you need to find out what old owncloud version you were running.  Try running this command if you don't care:

slice@own $ wget http://download.owncloud.org/community/owncloud-`cat $ocbak/config/config.php | grep "'version'" | cut -d'=' -f2 | sed "s/.*'\\(.*\\)'.*/\\1/g"`.tar.bz2

That may fail - if so, take a look at the config file to get your version number.

slice@own $ vi $ocbak/config/config.php

Somewhere you'll see a line that looks like this:

'version' => '5.0.14',

Hit google for the download link for that tar file, or just do this:

slice@own $ wget http://download.owncloud.org/community/owncloud-5.0.14a.tar.bz2
slice@own $ tar xjf owncloud-5.0.14a.tar.bz2
slice@own $ mv owncloud /var/www/owncloud-5
slice@own $ cp -rfv $ocbak/* /var/www/owncloud-5
slice@own $ chown -Rc www-data:www-data owncloud-5

Edit the config file (/var/www/owncloud-5/config/config.php) to point to new data dir  (/var/www/owncloud-5/data).  Then restart apache and log in to the site and make sure everything is good.

slice@own $ /etc/init.d/apache2 restart

Installation the second

Now we basically do the same thing over again with owncloud 6.  (Right now this is the latest - in the far future you might want to go to version 6 before going to whatever the current version in your unimaginable future time is.)

slice@own $ wget http://download.owncloud.org/community/owncloud-latest.tar.bz2
slice@own $ tar xjf owncloud-latest.tar.bz2
slice@own $ mv owncloud /var/www/owncloud-6
slice@own $ cp -rfv /var/www/owncloud-5/data /var/www/owncloud-5/config /var/www/owncloud-6/
slice@own $ chown -Rc www-data:www-data owncloud-6

Edit the config file (/var/www/owncloud-6/config/config.php) to point to new data dir  (/var/www/owncloud-6/data).  Then restart apache and log in to the site and make sure everything is good.

slice@own $ /etc/init.d/apache2 restart

Installation the third (?)

You now have a working owncloud 6 setup, so you could just stop here.  However, a little extra work now should make future upgrades as simple as a aptitude update && aptitude upgrade.

Just to make sure some old configs don't get in the way, we'll try to purge owncloud before we install:

slice@own $ aptitude update
slice@own $ aptitude purge owncloud
slice@own $ aptitude install owncloud
slice@own $ cp -fv /var/www/owncloud-6/config/* /etc/owncloud/
slice@own $ cp -rfv /var/www/owncloud-6/data /usr/share/owncloud/
slice@own $ chown -Rc www-data:www-data /usr/share/owncloud/data /etc/owncloud/

Edit the config file (/etc/owncloud/config.php) to point to new data dir  (/usr/share/owncloud/data).  Then restart apache and log in to the site and make sure everything is good.

slice@own $ /etc/init.d/apache2 restart

Cleanup

If everything worked ok, we can get rid of the intermediate installations and the tar files:

slice@own $ rm -rfv owncloud-5.0.14a.tar.bz2 owncloud-latest.tar.bz2 /var/www/owncloud-5 /var/www/owncloud-6
slice@own $ /etc/init.d/apache2 restart

I'm pretty sure some steps could be skipped - you may be able to skip both manual installations and just drop your old data files in the debian install directories.  If you're brave, try it and leave a comment.  But this way certainly works.

Sunday, June 23, 2013

get that google monkey off my back

It seems that email is too much of a pain in the ass to host yourself, but we can at least host our own contacts and calendar with CardDAV and CalDAV servers  These are two of the most important cloud-based phone features, if not some of the most sensitive.

OwnCloud is the option I went with.  I've been itching to do something with lil turbo ever since I got her put back together, and this is the perfect thing for it.

This is the sort of service I would contend ought to be isolated in a VM, so I installed virtualbox.  To this point, I had been keeping the Debian install on lil turbo headless, but creating a VM with vboxmanage is a pain, and I couldn't even think of a way to install the OS in the guest without a GUI, so I installed openbox - which was completely painless - and immediately fell in love with it.  I created the VM, installed a minimal Debian, and set it up:
  1. aptitude install vim htop nmap
  2. Edit /etc/vim/vimrc, uncommenting most lines
  3. Edit /etc/bash.bashrc and add the aliases I rely on
The folks at OpenSuse package ownCloud in a .deb repo, which is incredibly convenient - all you have to do is edit sources.list and add a key.

Aptitude found two conflicts, with libgd2-noxpm and apache-mpm-worker.  The first resolution that aptitude gave me was the one I went with, which involved uninstalling the noxpm package and not installing the apache one.  It seems to have worked ok.

After the install completes, open a browser and go to http://[serveraddress]/owncloud to begin configuration.  This is how everybody should do it - it's extremely convenient.

I had a warning about the .htaccess file being inaccessible, which I was able to resolve by editing /etc/apache2/sites-enabled/000-default - change the AllowOverride option inside the <Directory /var/www> block to be All instead of None.

Create an admin account and a database account.  You get a few options if you click "Advanced".  I left the DB option on SQLite, figuring for a small, single-user webapp, it shouldn't matter much.  SQLite is awesome for many use cases, but it doesn't have the performance of an in-memory database, which you would need if you were going to do much more with your ownCloud installation.

And that's about it!  Now ownCloud is installed and ready for you to set up!