We host a Rails app on AWS which uses mysql on the amazon-rds database. We have a giant table in the database which we want to migrate, but it takes days to make the migration because of the millions of rows. Specifically we're moving a VARCHAR
to a TEXT
column
How do I migrate this large production database without users experiencing downtime?
One idea I've heard is to setup a copy of the database, and make the migration there and switching it to be the main database when that's done. However I'm not sure how this would take account of user data entered while the migration is ongoing.
Update: This may be relevant: amazon-rds offers read replicas and Multi-AZ deployments which seem like they might be made for this type of thing. First time doing this, though, so would welcome guidance on any method whether it be this or another.