40
Views
4
Comments
Solved
Moving a mobile app to a new infrastructure - missing local data
Question
Application Type
Mobile

Hello experts, 

I've got a mobile app that was generated on infrastructure 1 (cloud), published to Google Play and App Store. 

  • published (using a solution) the same app into infrastructure (cloud) (infrastructure 1 is to be decommissioned)
  • made sure all configuration is identical  (eg: app id, keystore, certs, provisioning profile, etc ) 
  • generated the app 
  • updated the DNS entry to resolve the new infrastructure

The app automatically updated itself and pointed to infrastructure 2. Everything appears to be working except for the users' local data being missing (users' local data is not synced to the server). The local data re-appears after switching the DNS entry back to its original value.

What am I missing? How do I move a mobile app to another infrastructure and keep the local data of existing users?       

Regards,

CezarF

2021-06-16 06-20-58
Cezar Francisco
Solution

This issue is an expected behavior according to OutSystems. Hope the findings below can help others who might be looking for a solution.  

  • A new local database (SQLite\WebSQL) is created when a mobile app moved to a new platform, side-effect is that the local data appears to have been deleted from the end user's point of view
  • The local database name is the "<EnvironmentKey>_<ApplicationKey>"
  • The old local database is not deleted unless the app is uninstalled. It can be accessed with javascript using  "window.sqlitePlugin.openDatabase({name: dbName, location: 'default'})". The value of dbName is "<Old EnvironmentKey>_<Old ApplicationKey>"
  • The data can be migrated from the old local DB to the new one by querying the old database -> json -> deserialize to entity -> save 
  • sqlitePlugin is not available in forge but rather bundled with OutSystems. 

-cezarF

2016-04-22 00-29-45
Nuno Reis
 
MVP

Thanks for sharing. I was a bit puzzled with this behavior, but explained like this it makes total sense.

(I'm marking it as a solution since this issue will be looked for by others for sure)

2016-04-21 20-09-55
J.
 
MVP

Hi,


I am not sure what you mean with local data?

Afaik, the mobile local data should not vanish (you can check that with remote-debugging).

There are some questions:

However, when you move from infrastructure, that data will be gone and you need to export/import the server-data in itself.

Did you synchronize the users as well? Because that might be an issue as well.

Different infrastructure = different UserId..

2021-06-16 06-20-58
Cezar Francisco

Hi Joost,

Thank you.

The mobile app does not require users to log in hence userid is not the issue.  It allows users to save settings and personal data locally (local storage) of which are not being synced to the server due to privacy concerns. The server data is migrated to the new infra as well including end-users. 

I agree that the local data should not disappear. However, it looks like the mobile app creates a new local database (SQLLite) rather than using the existing one after applying the new DNS entry to resolve to the new infra.  As to what causes this behavior is still unknown.      

-cezarF

2021-06-16 06-20-58
Cezar Francisco
Solution

This issue is an expected behavior according to OutSystems. Hope the findings below can help others who might be looking for a solution.  

  • A new local database (SQLite\WebSQL) is created when a mobile app moved to a new platform, side-effect is that the local data appears to have been deleted from the end user's point of view
  • The local database name is the "<EnvironmentKey>_<ApplicationKey>"
  • The old local database is not deleted unless the app is uninstalled. It can be accessed with javascript using  "window.sqlitePlugin.openDatabase({name: dbName, location: 'default'})". The value of dbName is "<Old EnvironmentKey>_<Old ApplicationKey>"
  • The data can be migrated from the old local DB to the new one by querying the old database -> json -> deserialize to entity -> save 
  • sqlitePlugin is not available in forge but rather bundled with OutSystems. 

-cezarF

2016-04-22 00-29-45
Nuno Reis
 
MVP

Thanks for sharing. I was a bit puzzled with this behavior, but explained like this it makes total sense.

(I'm marking it as a solution since this issue will be looked for by others for sure)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.