At the time of writing this script using S3 based primary storage in Nextcloud does not work very well. Still you might have configured your Nextcloud to use S3 based primary storage as indicated here. But what if you want to switch to local primary storage?
Officially it is not supported to change the primary storage in Nextcloud. However, it's very well possible and this unofficial script helps you in doing so. It will transfer files from S3 based primary storage to a local primary storage.
:warning: This script was written in a rather quick & dirty way. It may fail and lead to data loss. Use at your own risk! :warning:
Related topics on the Nextcloud community are:
Just follow the steps below:
sudo -u nextclouduser php -d memory_limit=1024M transfer.php
). That's it! :checkered_flag:If everything worked you might want to delete the backup folder and S3 instance manually. Also you probably want to delete this script after running it.
This script was tested successfully on Ubuntu 18.04 using a Maria SQL database and DigitalOcean Spaces as S3 object storage. The Nextcloud version was 17. Please make sure to review the script carefully before you run it to avoid any issues. Consider it as a prototype and not a finished tool.
If you find this script useful and you make some modifications please consider making a pull request so that others can benefit from it. This would be highly appreciated!
This script is open-sourced software licensed under the MIT license. Please see LICENSE for details.