Migration of Parse Apps to Red Hat Mobile Application Platform
Red Hat has been working on a detailed migration guide to assist existing Parse enterprise customers in migrating their services to the Red Hat Mobile Application Platform.
Join the DZone community and get the full member experience.Join For Free
Following the announcement from Parse on January 28th that they will be shutting down operations in a year’s time, Red Hat has been working on a detailed migration guide to assist existing Parse enterprise customers in migrating their services to the Red Hat Mobile Application Platform (RHMAP).
With the release of the Parse Server Node.js module, the migration of Parse Apps from the Parse Cloud based hosting to RHMAP couldn’t be easier–requiring only minimal code changes to both the cloud and client code. We’ve made it even easier with the release of a pre-prepared RHMAP template application which, when deployed, provides a pre-configured parse-server environment to run your parse cloud services.
Parse server requires a MongoDB connection and Node.js both of these are provided as standard in RHMAP.
Parse Server does not provide support for push notifications, Parse’s recommendation is to migrate to a different Push provider. With RHMAP, this is not necessary, because RHMAP has push messaging built in, deploying Parse Server on RHMAP maintains support for push notifications with minimal code changes.
Step 1 – Create a Blank Red Hat Mobile Project
Login to the RHMAP Studio and create a new project using the “Bare Project” template. You can easily access this template by clicking the “Blank” filter on the left of the project creation screen.
When ready click “Create” and once complete click “Finish”.
Step 2 – Create a Cloud Application
After clicking “Finish” you should be brought to the project overview as shown below.
On this screen click the small plus icon in the “Cloud Code Apps” tile, or “Create a Cloud App” in the yellow banner. This will bring you to a screen with a number of creation options, but we want to choose “Import Existing App”, and then select the GitHub Repository option. When prompted for a URL enter https://github.com/feedhenry-staff/rhmap-parse-server-template.git, set the branch to master and then click “Import and Move on to Integration”. The below screenshot show the configuration options.
Step 3 – Add Custom Parse Cloud Code
Now that you’ve generated a Cloud App and we’ve auto deployed your code, you’ve finished the setup. You can start adding your existing Parse code to the project, or start fresh. To add code you can use our online editor or clone the project locally using Git and push code back up using Git. The template has some sample parse code in application.js that loads a main.js file that can contain more Parse Cloud Code.
Step 4 – Update your Client SDK
The Parse SDK used by your client apps will require an update to the configuration options to allow the client SDK connect to the new hosting environment.
Parse.initialize(“YOUR_APP_ID”, “YOUR_APP_CLIENT_KEY”); Parse.serverURL = ‘https://my-domain-sjliqvx4i2vw5ajmbw5publj-rht-dev.mbaas1.rht.feedhenry.com/parse’;
The Parse.serverURL configuration option should be updated to point at the RH MAP deployed cloud code. You can find the URL by checking the Current Host on the Details tab of your Cloud Application as shown.
For more information on updating the Parse client SDK, go to https://parse.com/docs/server/guide#using-sdks
Optionally, to take advantage of the RHMAP lifecycle management capabilities, the addition of the RHMAP client SDK to your app will allow you to configure the Parse.serverURL via the $fh.getCloudUrl call. This would allow the maintenance of client -> cloud connections using the RHMAP lifecycle management tools.
That’s it—once your client app is re-deployed with the updated client settings the migration from Parse to the Red Hat Mobile Application Platform is complete.
Check out the Red Hat Mobile Application Platform documentation to see what additional benefits the Red Hat Mobile Application Platform can provide to your solution.
Published at DZone with permission of , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.