I’m working with a python script that’s defining a table using PynamoDB. Currently it has a single hash and range key, but the range key needs to be renamed. The data format will stay the same (timestamp), but the historical data needs to (ideally) use the new name.
I’m seeing conflicting sources when it comes to renaming the range key without having the migrate everything to a new instance. Anyone know the most up-to-date process for this? Thanks in advance!
I’d highly recommend adapting your stack to be flexible with regard to the name of your DynamoDB tables. You cannot even use the built in backup and restore functionality and restore to an existing table name - you need to create a whole new table to restore.
Basically, DynamoDB is built around the concept of doing full copies from one table to another when you want to do a migration of any real consequence. Plan accordingly
oh, I can completely sympathize, don’t get me wrong.
I’m just letting you know, Dynamo literally doesn’t support renaming things without doing a full migration from one table to another.
the good news is, since ddb is schema-light, migrations are actually pretty simple - just do a table scan and copy everything over while renaming or transforming whatever you need to.
Dynamo literally doesn’t support renaming things without doing a full migration
You mean renaming index keys, right? To my knowledge, all other attributes can be added/removed/changed without causing any errors (aside from separate scripts not locating certain attributes).