Monday, December 10, 2012

How to configure external storage for Owncloud in Windows

Most of the people I know who have tried Owncloud as a personal cloud solution (in alternative to Dropbox) have been discouraged by the difficulties they encountered setting up pre-existing folder as online content for a new Owncloud instance running on a Windows server.

In fact when you install Owncloud a new empty database instance is created and the theory is that you have to move all your files to it or accept the idea or setting up a new tree from scratch.

Fortunately there is another way, which is mounting one or more folders to Owncloud to get them shown in the web interface. This procedure is a tricky one mainly due to the fact that no Windows-specific procedure has been published until now.

The only information that can be found is limited to:
So that's why today I am writing this post for those who have Owncloud instance running in a Windows environment and are willing to mount their existing folders into it.


Start by browsing to your Ownloud website (http://yoursite/owncloud) with a web browser and click on the lower right corner (circled in red) for the 'Settings' windows to appear, then click on 'Apps' (circled in blue). Now click on 'External Storage Support' (circled in green) and enable this feature.


Now open explorer.exe and move to C:\inetpub\wwwroot\owncloud\config. Create a new file named mount.php. Edit your file (I recommend using Notepad++ for editing php files. It is free.) and paste the following code:
<?php return array (
 'user' => array (
  'cloudadmin' => array (
   '/$user/files/my_data_folder' => array (  'class' => 'OC_Filestorage_Local',  'options' =>   array (    'datadir' => 'x:\\my_data_folder',  ),),
  ),
 ),
);
?>
Just replace 'cloudadmin' with the name of the user you want to mount the folder for and 'x:\\my_data_folder' with the name of the folder where your existing data are. Be aware of the double backslash in the path.

On the contrary, if you want to give access to a group of users (such as 'admins'), the third line is different:
<?php return array (
 'group' => array (
  'admins' => array (
   '/$user/files/my_data_folder' => array (  'class' => 'OC_Filestorage_Local',  'options' =>   array (    'datadir' => 'x:\\my_data_folder',  ),),
  ),
 ),
);
?>
Refresh your Ownloud website in the browser and the mounted folder should appear. That's all. Please comment if I helped you with this post!

7 comments:

  1. What happens regarding to file / CIFS permissions?

    ReplyDelete
  2. @AAron

    Can you be more specific. What's your issue?

    Carlo

    ReplyDelete
  3. Hi,

    I'm installed OwnCloud on WAMP into windows 7 x64, and I try your instruction, but it seems that the mount.php file is not taken...

    Have you an idea ?

    Thanks in advance

    ReplyDelete
    Replies
    1. @Frédéric,

      Have you enabled the External Storage application?

      Did you save mount.php under your website inside the config folder?

      What program do you use for editing text files? Stay away from notepad, use Notepad++ instead.


      Delete
  4. do you have by any chance procedure concerning FTP configuration?
    thx!

    ReplyDelete
  5. Well I'm using WAMP into Windows 7 x64 too and is not working for me. I enabled the application saved the file and I used Notepad++. Any idea about this ?

    ReplyDelete
  6. I'm using the WIMP on win8 x64 and it doesnt work for me neither. Yesterday, i received error message about the write permission on the folder. But today, this error message doesn't appear anymore. I have create the mount.php exactly as you said, but the folder didn't appear. I created a folder in owncloud, before adding this in mount.php

    'cloudadmin' => array (
    '/$user/files/the_new_created_folder' => array ( 'class' => 'OC_Filestorage_Local', 'options' => array ('datadir' => 'x:\\my_data_folder',),),

    the folder appear, but i can't open it. The external storage is on a seagate NAS.

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...