NC primary storage migration to S3

l would like to migrate a NC from local storage to S3. I can’t find anywhere a proven way to do this. Has anyone done this successful.

From what I can see I have two options:

1st

Backup and Restore the database. But how to transfer the files. In S3 the files are stored not in a plain file format but something like:
urn:oid:18
urn:oid:23

2nd

Use the new data migration feature for each user.

Please comment.

You do not need to do anything with the database. It will be moved.

As for option 1: You would not want to bypass Nextcloud to migrate the data (files). The downside to Primary Storage is that you must only upload files through Nextcloud.

Off the top of my head, I personally would probably bring up a second (new) NC stack that is using S3 as Primary Storage then mount that NC instance as a External Storage instance on the old (existing) NC instance.

Beware though I’m unaware of an accepted/supported strategy for doing this. Shares/etc will break.

Option 2 would certainly work.

I might explore a few other ideas, but how much time and effort to put into this depends on:

  • how many users?
  • how many shares?

I’d also weigh this against just mounting S3 directly as External Storage, which can be done with at the admin and per user level.

Not complete thoughts by any means. Just some loose casual thoughts off the top of my head.