Moving Data to iCloud

I have an app that has been in the App Store for years. I want the app to use iCloud so I need to move the app data from AWS to iCloud into a public database. I have already written the app to use CloudKit, so I just need to move the data. I wrote a new app to read the data from AWS and write it to iCloud using CloudKit. I had to change the bundle identifier to match my app in order to get the data in the correct iCloud container. The data gets written into Development and I need it to go into the Production. Since I believe I need to have the app live or in TestFlight to write to production, it seems like I'll have to add the code to move the data into my current app, get the app approved by Apple for testing, and then run the app downloaded from TestFlight to move the data, then take that code our before releasing the app. Is there a better way to accomplish moving app data from AWS to iCloud?

Accepted Reply

First migrate the records to the production environment from the dashboard

then set com.apple.developer.icloud-container-environment to production in the pList

then do what you did before to populate the record but this time in production.

Replies

It is not necesary to change the bundle identifier, instead of init a CKContainer using CKContainer.default(), use CKContainer(identifier:"YourContainerIdemtifier"), and select the container you would like to use in XCode capabilities.

First migrate the records to the production environment from the dashboard

then set com.apple.developer.icloud-container-environment to production in the pList

then do what you did before to populate the record but this time in production.

Thanks.