Suppose I have a package with classes which I want to rename. All these classes are persistent and they already have a lot of data stored.
The best I can think of to do is the following:
- Duplicate class definitions of old classes, rename each of them and save
- Write a routine to copy (duplicate) all the data from old classes to new ones. (which is not trivial at some point)
- Refactor all the application's code to use new classes. (which may not be trivial at some point too)
- Test the things above
- Load new code to live environment and launch the script
- Hope that
5.finishes successfully. If not, revert the code and jump to
Are there any better approaches than this? Maybe any utilities or better methods of renaming a class. I read this and this, but I am still not sure whether, say, instead of
2. a simple globals export/renaming/import won't corrupt the data (as the column numbers may change, etc).
Thank you for any advice!