Interesting. Never knew about MANAGEDEXTENT parameter, mentioned by @Robert.Cemper. And yes, backup your globals.

But in your case, @Nikita.Savchenko, I would go with the following. Consider you have class A and rename it to class B.

1 - is yours.

1a. When duplicating be SURE, that you take class storage definition from A, not generate it because of compile. Change places with global A  to global B in storage definition and compile class B.

It's MANDATORY to take class A storage def to B class definition and compile after that and not use generated storage definition in class B.

2. Merge data globals from class A to class B. E.g.

USER> m ^BD=^AD

3-4 - yours.

5. Load new scripts and make global merges and test.

6. Is yours.