Zero downtime migration from Telerik Platform to SashiDo
Migrating from one backend to another is not an easy process and we know it. With enough migrations behind our back, SashiDo is here to help. By the time Telerik Platform closes its doors in May 2018, you should have already migrated your data, business logic and front end, etc. to another backend. We have covered that up in Checklist for successful Telerik Platform migration. When that happens their services will no longer respond, which would render any application using them - useless. Here's what you can do:
Prepare early on
There's a saying "Luck favors the prepared", but we don't want to leave anything to luck right? Since there are a few more months left until May, there's plenty of time to prepare. First of all, you would want to make your app aware that at some point it would have to start using your new backend of choice. That would be very easy and basic for the time being - just create a cloud function in your Telerik Platform backend. Let's call it canWeStartUsingSashidoAlready and have it return false. Now, you can add a check on app startup that calls this function. If it returns false, it will continue to work normally, otherwise, if it returns true the user is prompted to go to the AppStore and get the latest version. In the best case this check will also happen every 30 or 60 seconds, so users that didn't close the app get the prompt too. Since we are now prepared, let's move on to the next chapter of our migration journey.
Everlive.CloudFunction.onRequest(function (request, response, done) {
response.body = false;
done();
});
Start using SashiDo and Parse
First, make sure to go through the checklist above, so that your backend is migrated to SashiDo. Next up, you would have to change your app to work with the Parse SDK. Our blog post Crash course with Parse Server for Telerik Platform developers will be very useful here. This is the part for you where most of the work will happen. There's also a slight complication you might notice on this step. "How would my users log into my app after the migration, passwords are encrypted?" - you might ask. Don't worry we have it figured out for you. See, when we migrate your data from Telerik Platform to SashiDo, we set a field called shouldChangePasswordAfterMigration on each of your users, and it's true by default. Here's how it is gonna play out when a user goes to login with your new app:
- He would see the login page, because he doesn't have a valid session.
- Upon entering his credentials and clicking login, your app, will check whether the field mentioned above is set to true.
- If it is, the user is prompted to change his password. It’s recommended that a confirmation email is sent to the user, to keep security top notch.
- After that, the field is set to false and the app continues to work as usual.
Parse.Cloud.define('shouldChangePasswordAfterMigration', function(
request,
response
) {
const { userID } = request.params;
const query = new Parse.Query(Parse.User);
query.equalTo('objectId', userID);
query.first().then(user => {
if (!user) {
return response.success(false);
}
return response.success(
!!user.get('shouldChangePasswordAfterMigration')
);
});
});
Alright, let's move along.
Deliver your new app to the users
After we have set the check in the old version that would prompt the user to update when the canWeStartUsingSashidoAlready cloud function returns true and have a new app ready it can be released to the AppStore. After it's release, go to the Telerik Platform cloud code browser and set the cloud function to return true. Your customers will update their applications and won't even notice that you have switched to SashiDo. That is unless you add some cool functionality using our features of course, e.g. live queries.
Bonus
Since SashiDo allows you to have custom domains, you can have a subdomain like mobile-api.customdomain.com and if in the future you decide to switch Parse Server provider, you can just point the domain to your new hosting and everything will just work.
Success
You have successfully migrated your application. Maybe it's time to take that vacation? In any case, we will see you around.
Happy coding!