This script solves error number ID 31224 "Create protection group: <protection group name> failed. The ‘Allocate Replica’ task for <data source name> failed" in semi-automatic mode (with confirm).
The following Powershell script can be used to remove recovery points for the data source we want to change or migrate. This script removes all recovery points for the selected data source that are older than the newest replica ("current") creation time. As a result the oldest replica ("previuos") will be automatically deleted.
Verified on the following platforms:
Also the article (in Russian):
Translate (in English):