Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RailsConf 2019 - How to migrate to Active Storage without losing your mind by Colleen Schnettler _______________________________________________________________________________________________ Cloud 66 - Pain Free Rails Deployments Cloud 66 for Rails acts like your in-house DevOps team to build, deploy and maintain your Rails applications on any cloud or server. Get $100 Cloud 66 Free Credits with the code: RailsConf-19 ($100 Cloud 66 Free Credits, for the new user only, valid till 31st December 2019) Link to the website: https://cloud66.com/rails?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 Link to sign up: https://app.cloud66.com/users/sign_in?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 _______________________________________________________________________________________________ Active storage works seamlessly in new rails applications - but how many of us only work on new applications? Migrating to Active Storage can be a daunting task on a production application. This talk will explain active storage, why you might want to use it, how it modifies your database, and the benefits and drawbacks of migrating your existing application. I’ll walk you through my painful journey migrating an existing application. You will leave this talk with a better understanding of the inner workings of active storage and with the confidence to tackle your own migration. This talk is appropriate for all levels of skill and no prior experience or knowledge of active storage is required.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video titled "How to migrate to Active Storage without losing your mind," presented by Colleen Schnettler at RailsConf 2019, explores the challenges and solutions involved in migrating a production application from Paperclip to Active Storage in Ruby on Rails. Colleen shares her journey of migrating a Rails application utilizing Amazon S3 for storage and provides insights into the inner workings of Active Storage. **Key Points Discussed:** - **Introduction to Active Storage:** Active Storage allows Rails applications to easily attach files to Active Record objects and store these files in cloud-based storage providers. It's important to migrate because Active Storage is now the default solution for handling file uploads in Rails, and Paperclip has been deprecated. - **Migration Steps:** 1. **Install Active Storage and configure:** Colleen explains the installation process, configuring cloud storage, and creating necessary tables in the database. 2. **Moving Data:** The process of migrating data from the existing user table (where Paperclip stores attachments) to the new Active Storage tables (attachments and blobs) is critical. 3. **Writing a Rake Task:** She discusses writing a Rake task to facilitate this migration, emphasizing understanding the structure of the existing data and mapping it correctly to the new tables. - **Common Pitfalls:** Colleen elaborates on potential issues, particularly focusing on the correct handling of keys and checksums when moving files to Amazon S3. She highlights how data relationships defined by Paperclip need careful consideration to avoid errors during migration. - **Testing the Migration:** After running the Rake task, it’s essential to verify the migration's success by checking that the correct number of records exists in the new tables and optionally peeking into the database to ensure data integrity. - **Variant Processing:** Active Storage's support for image variances offers new possibilities for image sizing, although she notes some limitations with image processing capabilities of the previous tools compared to the new ones. - **Conclusion and Best Practices:** Colleen concludes with a summary of her steps and stresses the necessity of validating each phase of the migration. She points out that while Active Storage may seem straightforward to use, it requires a solid understanding of different configurations and careful handling of existing data to ensure a successful transition. By the end of this talk, attendees are equipped with knowledge on how to approach their own migrations confidently, avoiding common pitfalls and ensuring a smooth transition to Active Storage. **Main Takeaways:** - Active Storage is a robust solution for handling file attachments in modern Rails applications. - Migration requires careful planning, awareness of database structures, and writing scripts for data mapping. - Ensuring data integrity during the migration process is essential for a successful transition.
Suggest modifications
Cancel