Reputation: 1123
I have just upgraded to SDK 1.7.7 and my application can no longer access the local data store. I've Googled a bit and found that this usually occurs when upgrading the SDK.
I can't seem to find any solution that will allow me keep my existing data. I have set up a ton of test data in my datastore that I don't want to have to re-create. Is there ANY way to transition/migrate the data in the local datastore from one SDK version to another?
Upvotes: 0
Views: 128
Reputation: 3639
The steps I use are:
1) make a remote_api connection https://developers.google.com/appengine/articles/remote_api
something like
static RemoteApiOptions options;
options = new RemoteApiOptions().server("localhost", 8888).credentials("", ""); // password doesn't matter
RemoteApiInstaller installer = new RemoteApiInstaller();
installer.install(options);
2) fetch my data (this is for me with Objectify, but it'd be how you'd normally do it)
UserDAO udao = new UserDAO(false);
Query<UserOFY> qu = udao.ofy().query(UserOFY.class);
3) persist my data to the harddrive
something like
FileOutputStream fileOut = new FileOutputStream(LOCAL_AE_BACKUPS_USER + "/" + USERS_FROM_LOCAL_BACKUP + "_" + u.getNickName());
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(u);
out.close();
then I just do the reverse after upgrading the version.
1) read the persisted data on my hard drive
2) make a connection to the local datastore
3) persist the data to the new version of the local datastore
Upvotes: 1