mrAceT / nextcloud-S3-local-S3-migration

Script for migrating Nextcloud primary storage from S3 to local to S3 storage
GNU General Public License v3.0
67 stars 11 forks source link

A missing step migrating from S3 to local #12

Closed TheBluestBird closed 6 months ago

TheBluestBird commented 6 months ago

Thank you so much for the script, had to adapt it a bit, but it seemed to have worked in the end. Have found out that there was a missing step migrating from S3 to local storage. It looked like the previews wouldn't be loaded and always give up 404.

The thing that helped is this kind of sql query to undo the migration to S3 step:

UPDATE oc_mounts 
JOIN oc_storages ON oc_mounts.storage_id = oc_storages.numeric_id 
SET mount_provider_class = 'OC\\Files\\Mount\\LocalHomeMountProvider' 
WHERE oc_storages.id LIKE 'home::%' and mount_provider_class = 'OC\\Files\\Mount\\ObjectHomeMountProvider';

Also would be nice to add oc prefix from config

mrAceT commented 6 months ago

@TheBluestBird you are welcome :)

And thank you for noting this. This step is performed in local to S3, but not in S3 to local!

I have added and converted that piece of code => S3toLocal v0.32

I expect it will do the trick, but if you would be able to tet and confirm, that would be great.