16. | Everything You Need to Know About Migrating Applications
● What is the type of data
stored?
● How many records does it
hold?
● How many attributes does it
have?
18. | Everything You Need to Know About Migrating Applications
On Premise
Follow the guide
provided by
OutSystems
19. | Everything You Need to Know About Migrating Applications
Cloudy with a 60%
chance of trouble
● Not able to clone and
restore the Database
● Not able to change the DB
rules
20. | Everything You Need to Know About Migrating Applications
Tackling the Beast
21. | Everything You Need to Know About Migrating Applications
Step by Step
Example - > Error in production reported by the key user’s goes along the way until the dev tries to replicate in order to apply a fix
In order to resolve the issue, the devs first attempt to replicate it in the development environment
Train a new set of users with the same data as the ones already using it and in this way not impacting in the other user’s experience
Tuning timers and long running operations running in production, using real volume of data but again not impacting the users already using the production app
First we must move the application code
Provided from the box by OutSystems, you just need to go to lifetime and pick the applications that you want to migrate
Now that the application’s code is done, that are still some things you should keep in mind
Typically you don’t want to use the same endpoint across a prod environment and a testing one
The Data
Backup of the destination if it isn’t a clean slate
Know your data model
Entity dependencies
What are the primary keys, how do you identify a single record
Physical vs logical data model – know what tables are related to the applications that you want to migrate, active attributes
Early decisions that are difficult to handle later
Attribute not set as a foreign key in your meta model but used as one in your application
Since you have analyzed the data model, now would be a good time to clean up after unused attributes or entities
To truncate in a cloud infra you need to request access with a database management tool, via VPN
You can use a supported tool like DBCleaner_API
Know your data
Does it include binary data
For On-Prem to On-Prem environments there is a guide provided by OS
You can clone your DB and then restore it in the target
You can disable the auto-number constraint if you want to start with a specific id
You can disable the referential integrity of the model
The environment is in OutSystems Cloud, not just cloud based
If the source environment is cloud based to import the data you have 2 options : Direct database access credentials and third-party database tools, Develop your own data extraction mechanism with OutSystems.
Target environment being cloud based – external databases ,you can use an external database(if you want to write over it in the migrated app) there is not much problem you just need to set it up in service center(but it would be stored as an external entity),cant restore the DB, the id’s of your entities are not guaranteed to be the same on both environments
How can we do this migration
Create new application responsible for the migration, one on the source environment and another at the destination environment to have a better control over the migration process
Stop your application, go offline.
Expose a service in the Original application, and then consume it in the destination.
Create actions to handle specific entities, handle the migration entity by entity
Scramble the data, including user access, re-use the same password for every login in the test environment
Source application should be offline when fetching
Every record inserted will have a new id, so we need to map the new id’s with the old ones
Destination app should be offline when doing this
Have a new entity with these fields to be able to map the id’s correctly
Create a new record in this entity every time you insert a record
Actions to update the foreign keys of entities using the created mapping entity
Keep your migration help records until you update every reference to that table
Create action that updates all the references and then deletes the mapping for that entity
Start up the engines because you are good to go
There are systems entities that point to the users entity so you should not delete records from this table and should look to merge results from one environment to the other
The users records make use of a flag, so they are soft deleted(marked as non active) instead of being deleted from the table
Move the records, and then for each record see if you have a corresponding user in the target DB(active or inactive) via username , create the records that do not find a match and update the others
BPT, the processes related to BPT are stored in internal tables of OS so cannot be inserted into the DB
Intro to automating
When starting a new application develop it with a possible migration already in mind
Create services to expose the data while developing, applying scrambling rules if valid
Build an application that inspects the schema and determines the relationship between entities and that can run the necessary updates for the foreign keys