Core Data Empty on App update - core-data

I had created a new modal version for Core data and assigned it to current modal version, so migration to it must be done(I hope), but now as I am doing old version of App to new version test, all the data is lost, what could be the possible problem?modal versions current version
I have found that the existing persistant store is not compatible and so it is deleting it and creating new one! So how do I prevent this?

Related

Xcode Swiftui -- when Core Data entities are deleted, app crashes on My Mac(designed for iPad)

Whenever entity changes to CoreData are made (especially on deletion of an entity)-- other than adding attributes, the simulator will crash.
Deleting Derived Data does not help...I am assuming because the Simulator stores data from previous builds. On ios Simulators it can be solved by deleting the app instance on the simulator; but using the "My Mac (designed for iPad)" proxy this cannot be done... or am I missing something?
The only thing that helped was to find the app sqlite file and delete that (not easy to find), which forces the project to reset everything.
Any other suggestions, or is this a bug?
From your description it sounds like you're editing the data model, in the Xcode model editor. Basically, you can't just do that unless you configure your app to migrate existing data from the old model to the new one. When the app launches, Core Data needs to match data it already has (the persistent store) to the data model the app has. If they don't match and Core Data can't figure out how to automatically convert the data, the app crashes.
For relatively simple changes, Core Data can figure out what to do and takes care of things. For other changes, it can't do that, so it's up to you.
If you don't need to keep old data (like, you're still developing the app and you only have test data), then what you're doing is normal. Delete the older version of the app and start fresh. There's no need to update your test data to match the new model.
If you do need to keep old data, you need to create a new version of the data model but keep the old one around. Core Data knows how to handle multiple versions of the data model; you'll tell it which one is current, and the others will all be old versions. Then, depending on what exact changes you made in the model, you can migrate the data to the new version. This is a whole topic on its own and if that's the case, please post a new question with the exact details of your changes and someone may be able to help.

Does a desktop-bridge app auto-update through the Microsoft store

I have a traditional Win32 desktop app written in C++/MFC that I have packaged as a UWP app for the Microsoft store using the desktop-bridge facility in Visual Studio 2019. It is currently published on the store, and users have been downloading it successfully.
I now need to release an update. I have incremented the Version numbers in the Packaging tab of the Package.appxmanifest and have a package just-about ready to submit to the Store. I hope (expect?) that current users will get their existing copy of the app automatically updated if they have set that choice in the Store app itself, or if they manually check the Store for updates. However, I am not sure whether that is actually true. Do I need to do anything within my program itself to make that happen?
Thanks for any help.
Yes, desktop bridge apps published in the Store update automatically.

Releasing new Core Data Schema to iCloud production

I have an app out in the App Store, and I am working on a lightweight migration (adding new attributes and new entities, not deleting anything). From extensive research, I know that I need to add a new version of my current Core Data Model for the local version of the data model. Anyone who updates their app and only uses the local data will automatically be migrated over.
However, I can not find anything about what happens when I update the iCloud schema (from icloud.developer.apple.com). Mainly, I'm concerned about users who are on older versions of the app and are using iCloud. When I update the schema in the iCloud website, will users on an older version of the app lose their current data or not be able to sync their data since their local schema will be different from the iCloud one?
Also, I'm using an NSPersistentCloudKitContainer for syncing the Core Data with CloudKit.
Any help is greatly appreciated as I do not want to mess up anyone's data!
No, their data still be on iCloud and they could continue to use your app.
When your Schema is deployed to the Production environment, you can not change types of Records or delete them, so all your changes will be done only in addition to the current Schema settings and does not affect users, which have not updated the app yet.
I had a similar question previously and was quite anxious about updating my app Schema, but everything went well - no problems for users and no data was lost.
Do not forget to initialize your new scheme from the app and deploy changes to the Production on iCloud dashboard.
You could initialize your scheme in your AppDelegate when you initialize your NSPersistentCloudKitContainer with following code:
let options = NSPersistentCloudKitContainerSchemaInitializationOptions()
try? container.initializeCloudKitSchema(options: options)
After that you could comment out these lines until the next update of Core Data model.
You could check that all changes are uploaded in the iCloud dashboard by clicking on Deploy Schema Changes - you will see a confirmation window with all the changes to the model which will be deployed.
It is also possible to change your Scheme directly in the iCloud dashboard, but it is not so convenient (unless you need to add just one Record type).
Since changes in the Schema are not affecting existing users, I usually move them to Production before I submit the app for review, but after all testing related to new Record types is done and I am not planning to change anything there.

What happens if I update my extension WITHOUT incrementing the version in the manifest?

I know that when you publish a new version of your extension to the Chrome Store, you're supposed to increment the version in the manifest file. BUT what if I publish an update WITHOUT incrementing the version? What I would want to happen is that the old users that already have the extension don't get the update, but any new installers get the latest version. Is that what would happen?
The reason I want to take this approach is that the new version of my extension will request increased permissions, and I don't want the extension to auto-disable for all my old users where they are then asked if they want to enable it given the new permissions, and that's what happens when there's a permission level increase. I'm afraid that if that happens, my install counts will drop.
You can't upload a package with the same version number as the already published one, just tried myself and got this error:
An error occurred: Failed to process your item.
Invalid version number in manifest: 1.8.2. Please make sure the newly uploaded package has a larger version in file manifest.json than the published package: 1.8.2.

Access 2013 web app - restoring previous app snapshot package without reverting data (structured staging environment)

I have a reasonably complex Access 2013 web app which is now in production on hosted O365 Sharepoint. I would like to take a backup (package snapshot) into a test environment, and then migrate this to production once development is complete (I certainly don't want to do development on the production system!). The problem is that the snapshot also backs up all data so uploading the new package over the top of the existing package in the sharepoint app repository reverts the data to the time of snapshot as well. Alternatively, rolling back to the original snapshot if there are issues would lose all data after the new package was applied.
I can easily get a second version of the app going by saving as a new application etc but this creates a new product ID etc in the app store. We also use a Access 2013 desktop accdb frontend to hook directly into the Azure SQL database to do all the stuff that the web app can't provide (formatted reports etc) so I cant just create a new app every time without dealing with all of the credential and database renaming issues.
So my question is, does anybody know how to safely operate a test environment for Access 2013 web app development? One needs to be able to apply an updated version, or rollback to the old one if there are problems without rolling back the data. With the desktop client I can just save a new copy of the accdb file every time obviously. I dont mind creating a new instance or link to the app on sharepoint each time, however this obviously generates a totally new database (server name, db location, login id's etc) as well. You would hope there is a way to upload and replace your app without touching the data, else how else can you develop without working directly in production?
Any answers would be really appreciated.
Thanks.

Resources