Alright, so, now i've deleted all that entries in my database, it freed
a few rows, and everithing seems to be working alright.
I'm leaving here the query i've used to clean all the database
duplicated rows, just in case it's of some use for anyone else.
-------------------------------------------------------------------------
START TRANSACTION;
DELETE oc_filecache
FROM oc_filecache , oc_storages
WHERE
oc_storages.id LIKE 'local::%' AND
oc_storages.numeric_id = oc_filecache.storage;
DELETE FROM oc_storages
WHERE id LIKE 'local::%';
COMMIT;
---------------------------------------------------------------------------
|This deletes all the filecache entries related to any local::* storage
|existing in the database, and, after that, it deletes the entries from
the oc_storages table so that no more duplicated entries are created by
any chances.
I'ts recomended to make a backup of the tables, as always, before using
any code, but, it seems to be working for me pretty neat, we'll see if
any problems arise after this. I would also recommend issuing an occ
files:scan --all after using this code, just in case some entries are
missing in the database.
Thank you very much, Vincent, your input has been really useful to
resolve my issue.
El 12/01/2015 a las 10:33, Vincent Petry escribió:
Hello,
The "local::/absolute_path/to_owncloud/data/username" is the old storage
format and "home::username" is the new one.
You probably logged in as that user before you manually fixed the
absolute paths which caused OC to not find the old storage, so it
created a new one.
Are you saying that occ files:scan is recreating the "home::username"
storage every time ? Normally it should detect the old one and use that,
unless the format of the old one doesn't properly match the absolute path.
If you want to clean this up you could delete the old "local::" based
storage, including the matching oc_filecache entries.
Ref:https://github.com/owncloud/core/issues/10897
Hope this helps.
Cheers,
Vincent
On 01/10/2015 08:20 PM, WolFi wrote:
I've found some confusing stuff while migrating owncloud to another server.
My instance has been running since version 4 or 5 of owncloud, cant
remember for sure.
So, let's go to the point, i did the migration, i moved all the files
and databases to the new server, fixed permissions, changed paths on the
config file and everything seemed to work. Except it didn't worked
because the database had some references to absolute filesystem paths,
ok fixed that to on oc_storages.
But there was a problem with a single file, and rescanning the occ
files:scan didnt fixed it, so i checked the permissions, and everything
was ok, checked the database and there where no references left to the
old install path.
After a while i took a look into the oc_filecache table, and there where
2 references to the same file, and they were, apparently alright, but
they sync client kept saying "Access denied". So i deleted the
references to the file and issued another occ files:scan.
That fixed the problem with the file. Now, i check the database and
there is just one reference for that file, but 2 for others.
On the references it points to 2 different storages. One of them is of
type home::username and the other is of type
local::/absolute_path/to_owncloud/data/username/
What i don't understand its why are there 2 references for the same file?
Why are there 2 storages for the same user?
If that's needed, why the new scan left just 1 ref to the file?, if not,
should i delete all the not absolute storages and its references?
I don't want to fix this problem many times in the future.
Thanks in advance.
_______________________________________________
User mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/user
_______________________________________________
User mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/user
_______________________________________________
User mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/user