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
feat: Script to migrate images between providers #9117
base: develop
Are you sure you want to change the base?
feat: Script to migrate images between providers #9117
Conversation
lib/active_storage/migrator.rb
Outdated
|
||
puts "#{ActiveStorage::Blob.count} Blobs to migrate from #{from_service_name} to #{to_service_name}" | ||
ActiveStorage::Blob.find_each do |blob| | ||
next unless blob.image? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line prevents uploading of audio files received via WhatsApp. It will possibly impact PDF's and other files in general.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hiagodotme, of course, I assumed they wanted to export only images because the issue specifically mentioned images, but we can add other types of files without a problem. 👍🏼
🐢 Turtley slow progress alert! This pull request has been idle for over 30 days. Can we please speed things up and either merge it or release it back into the wild? |
Hi @sojan-official, can I ask you for help with the checks that I am not being able to pass, if you can help me identify what the problem is why I am not being able to pass the checks??? |
Pull Request Template
Description
Storage migration functionality, which allows the transfer of images from one on-premises provider to another (e.g. AWS, Google, etc.) using Active Storage.
I ran the unit and integration tests and they all passed correctly.
The command to execute the migration is
FROM=from_service TO=to_service rake storage:migrate
Fixes #7907
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I have tested the storage migration functionality by running the provided unit and integration tests. Additionally, I manually tested the migration process in a local development environment by following these steps:
Set up two storage services (e.g., AWS S3 and Google Cloud Storage) with valid configurations.
Execute the
FROM=local TO=amazon rake storage:migrate
task with appropriate FROM and TO arguments to migrate blobs between the services.Verified that the blobs were successfully transferred to the target storage service.
Checked for any error messages or unexpected behavior during the migration process.
Checklist: