Migrate data from Windows Phone (Silverlight) to a

2019-08-28 17:58发布

问题:

I've got an existing Windows Phone app that is out in the wild, and being used. I'd like to transition to a Universal App, but I'd like to be able to transition data from the existing local SQL database to something that can then be used by the Universal App.

My current idea is to push out an update to the Silverlight version that saves the data to be migrated as a well known filename in Isolated Storage - which in turn maps to the Local folder on the other side, and then move that out to the Roaming folder or rename as applicable. This approach does seem a little flawed that it requires end users to first pick up and run that update prior to my releasing the universal version.

So, is there a way to include a migration app as part of the Windows Phone package that could handle the migration in one go?

回答1:

You don't have a lot of options here. The Universal App you are going to create is a totally different app than your Silverlight app. Fact is, the frameworks intentionally make it so you can't chat between apps.

One strategy you might consider is to give your Silverlight app the ability to transfer its data to the cloud (or the user's OneDrive) and then have your universal app contain the capability to pull down the data from the cloud and import it.

I say all that to say, there is no native ability to do it. I know that's not a great answer and I hate to be the one to have to say it. But, now you know.

Best of luck.