Application update, data migration

I have a really old iOS app write in Swift (firsts versions) on Xcode. I want to make a new version with Xojo.

For now users save their data on a text file on their own device. Data ara store in a text file. How can I retrieve their data in a future new version and convert to a new format (sqlite)?

How can I test my migration code?

Thank you for help and happy new year :partying_face:

When you upgrade an app to a new version, it retains any data files in the app.

So I’m guessing that if you “update” the app to a new one written in XOJO that the files will also be retained.

1 Like

I know that, question is how to test code

I have a similar situation for a desktop app. The preferences have a version number. For a certain version number an SQLite database is created and values from the preferences transferred to the SQLite database. For testing I reset the version number in the preferences again and again.

1 Like

@Beatrix_Willius , my previous project use an XML file not a SQLiteDatabase. My question is about testing migration on simulator or in iOS device

1 Like

See if the xml file is present. If it is then move the data into your database and delete/rename the xml. Otherwise just open the database and you are good to go.

1 Like

Maybe build a specific feature in your older version that exports the text file to a folder accessible by all apps such as SpecialFolder.Documents… then produce your new version and have it migrate the data, allowing users the chance to migrate their data prior to deleting the older version from their devices?

As long as the bundle ID remains the same it doesn’t matter what tool you use to build the app. Could be Xcode and Xojo alternating releases if you really hated yourself

2 Likes

“… if you really hated yourself …”
:rofl: :rofl: :rofl: :rofl: :rofl:

Thanks, I needed a good laugh today.

1 Like