CentOS 8.x Owncloud changing datadirectory for a new installation
From Notes_Wiki
Home > CentOS > CentOS 8.x > Desktop tools or applications > Owncloud > Changing datadirectory for a new installation
There is updated article on this at Rocky 9.x Owncloud Manually moving DataDirectory
It is not possible to change datadirectory easily on an existing installation as various databases hashes and paths need to be updated. However, for a new owncloud installation (Tested on bitnami ownloud 10.6.0-2) we can change data directory using:
- Create folder for data directory. This could be an LVM mount point. For example /mnt/files
- mkdir /mnt/files #Or mount <lvm-device> /mnt/files
- Change the ownership on this folder to daemon:daemon
- chown -R daemon:daemon /mnt/files
- Move existing data directory files to this location
- cd /opt/owncloud-10.6.0-2/apps/owncloud/data
- mv * /mnt/files
- mv .* /mnt/files #Important to move .ocdata and .htaccess files
- Update '/opt/owncloud-10.6.0-2/apps/owncloud/htdocs/config/config.php' with the new path
- 'datadirectory' => '/mnt/files',
- Log into database using credentials from the above config file using '/opt/owncloud-10.6.0-2/mysql/bin/mysql -u root -p' and do following changes
- Check oc_accounts table
- select * from oc_accounts;
- If admin data folder is pointing to older path and not to updated /mnt/files then use following:
- update oc_accounts set home = '/mnt/files/admin' where user_id='admin';
- Check oc_accounts table
- Now scan for changes for all paths using
- cd /opt/owncloud-10.6.0-2/apps/owncloud/htdocs
- sudo -u daemon /opt/owncloud-10.6.0-2/php/bin/php occ files:scan --all
- Upload a small test file to admin user and check contents of /mnt/files/admin/files folder to see if the new uploaded file is available there.
Home > CentOS > CentOS 8.x > Desktop tools or applications > Owncloud > Changing datadirectory for a new installation