-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgres support, dry-run #1
Comments
Hi @krakazyabra,
Each time you run the script it backs up your SQL and config.. all to make the risk of permanently 'bricking' your setup as small as possible.. but as always.. be careful and check after every step you take ;) |
I use the script localtos3 every now and then to perform what I call a "sanity check", this is what I get:
The warning is logical since I'm already at S3 and only do the 'sanity checking'
I've seen someone having problems migrating who messed up the storage ID's so I'm just warning about that ;)
it waits for user input (like an enter) before continuing..
I read a lot about people complaining that preview images weren't deleted.. I haven't had one preview, ever, older then 1 year..
the more files, the more dots.. ;)
As the note says.. I have not had this problem, so can not test.. so check only ;)
At the end it'll tell you which folders you can remove.. but it's up to you to do that or not ;) |
Got it, thanks! I can have broken files in S3 (due to several outages). How script can by-pass them? Will it fail, or just make a report? |
I "only" have a 100+Gb of data.. it runs on a single thread.. when all goes well it actually goes quite fast.. In test-mode it'll only warn for every broken file in S3/local and go to the next.. ONLY in 'live mode' (test=0) it'll remove the broken database entries and orphaned S3 files! The thing is data copying.. with that "whopping 2Pb of data" getting back from your S3 bucket .. geez.. that'll take a while :P The great part though.. you can download per user.. and when it hangs/fails somewhere you can simply restart it.. and it'll check and simply continue where it stranded (with that amount of data.. chances are there will be a hickup somewhere sometime ;) When I migrated from local to S3 with my 100+Gb of data I started it in the night, canceled it in the morning (since it does "clog the channels.. even with one thread..) and I didn't want my users to experience any lagging.. and restarted it the next evening/night.. it'll get there.. ;) |
got it, thanks.
Anyway, I will try to edit this script for postgres and try it. |
So you don't have Nextcloud set up with S3 as primary ? Or you actually have an S3 bucket per user with S3 as primary? I didn't know that was possible?! One can add an S3 account to every user.. even with local as primary.. is that the way you work?
Well.. not by design.. but you could "hack the system".. but I think that would be waiting for an accident to happen..
I tried to make the queries and the structure as readable and "simple" as possible.. if you have questions, shoot! |
S3 is primary, but I'm using undocumented class array (
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' =>
array (
'num_buckets' => 1500000,
'bucket' => 'nextcloud-',
'autocreate' => true,
'key' => 'admin',
'secret' => 'secret',
'use_ssl' => true,
'hostname' => 'awesome-url',
'port' => 9000,
'use_path_style' => true,
),
), I have Minio S3 in local infrastructure.
well, that's hard to explain S3 principles, but I have one big scope, where admin user is nextcloud (check in config |
Needed to reed into that one a bit ;) Of what I read, is this still an issue nowadays? [update] So I think "I'm good" (?) |
https://github.com/nextcloud/server/wiki/How-to-test-S3-primary-storage
Because we can + by design. As I said, we're using own local S3 storage (min.io). you can distribute data between nodes more flexible. plus it will be easier to escalate data of customer. |
A day nothing learned, is a day lost, learned something today ;) In any case, this script does not support multiple primary S3 storages.. so you will need to "hack the script". If you have questions, shoot! PS: to get this working I created a small nextcloud installation with my "live config" and started digging in the database entries to figure out "where is what" and started testing with my migration script.. I think that is the best way to go.. I didn't want to start "hacking around" with 100+Gb of "real data of real users".. I think that is the best route too with 2Pb of data.. ;) |
If you have any questions you can find me in telegram @krakazyabra |
AD: I took a look at my S3->local script.. With you having multiple S3 buckets.. I think you probably need to comment a number of warnings that won't apply to you PS: sent you a message on telegram |
Hi!
Thanks for great job! Previously I had issue in original lukasmu/nextcloud-s3-to-disk-migration repo about postgres support. I'm not programmer, so I cannot implement that. But lot of users use postgres with NC. Will be awesome if you add psql support
Second question is about dry-run. Is it possible to run the script but without real copy of data, f.e. to test if everything is ok.
And third question: is it possible to copy from S3 to local, but keep objects in S3? in case if something will go wrong there should be possibility to switch back to S3. of course, DB backup is mandatory before starting.
The text was updated successfully, but these errors were encountered: