Surviving Parse Shutdown, Exploring The Kinto Alternative (1 / 2)

February 01, 2016 - 10 min read
Surviving Parse Shutdown, Exploring The Kinto Alternative (1 / 2)

This blog post is the first part of a 2 blog posts serie. In this part, we’ll talk about Parse shutting down and going open source. We’ll explore Kinto in the second part.

The shutdown announcement was a surprise for all of us, thankfully the Parse team provided a migration guide and open-sourced the Parse Server. The service will stop working on January 28, 2017, so now it’s time to prepare for the big change. In this post we are going to explain the steps to migrate your Parse-hosted apps to your own Parse Server instances on Scalingo.

Setup Parse Server on Scalingo

parse-server is a Parse-compatible Node.js module made for Express. It is not a stand alone solution but Parse do provide the parse-server-example app that can run out-of-the-box after a git clone.

To setup an instance of Parse Server on Scalingo 2 options are available, the automated one-click deployment and the manual way. We recommand you to use the automated solution to setup your Parse Server which is a great base project customizable in the future.

Automated One-Click Deployment

The automated solution is to use the Scalingo deployment button:

Deploy to Scalingo

This button will deploy the official parse-server-example project which is suitable to be used for existing Parse app migration. A MongoDB instance will be provisionned automatically for you during the process.

Follow these simple steps to setup your own Parse Server:

  1. Click on the Deploy to Scalingo button.
  2. Give your future Parse instance a name.
  3. Fill the APP_ID and MASTER_KEY. If you are migrating from an existing Parse app you can use the same values here. Otherwise, you can choose any string.
  4. You are now ready to deploy the application, click on the Deploy Application button.

If you want to use the deployed application as a base to your project you can git clone it. The command is git clone git@scalingo.com:my-parse.git where my-parse is the app name you gave earlier. You can now make change to the cloned project such as adding some Cloud Code. To deploy your changes just do a git push scalingo master and your app will be updated.

Manual setup

To follow the following steps you will need the Scalingo CLI. If you prefer using a GUI, steps 2 to 4 can be done in Scalingo Dashboard.

  1. Clone the parse-server-example project and change directory to it.
  2. Create an app on Scalingo: scalingo create my-parse
  3. Add the Scalingo MongoDB addon: scalingo addons-add scalingo-mongodb free
  4. Setup MongoDB connection string: scalingo env-set DATABASE_URI='$SCALINGO_MONGO_URL'
  5. Your are now ready to deploy your own Parse Server: git push scalingo master

Migrating from Parse to Scalingo

Once you’ve setup your Parse Server on Scalingo it’s time to migrate your Parse-hosted app. Be sure to read the official Migrating an Existing Parse App guide first to understand the process. The following points are the big steps that must be done to successfully migrate to a Scalingo hosted Parse Server.

Migrating Client apps

To allow your client apps (iOS, Android, web, etc.) to access your own Parse Server, you’ll have to change the server URL in each of your client apps to the Scalingo app URL (e.g. my-parse.scalingo.io). Instructions for each SDK are detailed in Using Parse SDKs with Parse Server.

By default, Parse Server will serve the Parse API on /parse. To change this, or if you are using older client SDKs, you can run scalingo env-set PARSE_MOUNT=/1. This command will set the environment variable PARSE_MOUNT to the value of /1.

Migrating Database

On Scalingo, databases are not publicly accessible for security reasons, so the process described in the official migration guide will not work. Instead, you’ll have to manually transfer the data to your Scalingo MongoDB instance. Here are the steps:

  1. Go to the new Parse Dashboard > App Settings > General, and click on Export Data.
  2. Wait for the email containing the link to download exported data.
  3. Change directory to your Parse Server project
  4. Start a tunnel to your Scalingo MongoDB using Scalingo CLI :
$ scalingo db-tunnel SCALINGO_MONGO_URL

Building tunnel to my-parse-4727.mongo.dbs.appsdeck.eu:31068
You can access your database on '127.0.0.1:10000'
  1. Prepare downloaded files by deleting the { "results": and } that wrap the array containing your collection data.
  2. Import each collection with the following command and change the options accordingly (--db, --collection, --file, --username, --password). To find out the password to your database you can use the commandscalingo env | grep MONGO.
$ mongoimport --db my-parse-4727 --port 10000 --username my-parse-4727 --password 6O65xJH3_k2qu0DeIfxg --collection yourcollection --file yourcollection.json --jsonArray

connected to: 127.0.0.1:10000
2016-02-01T18:45:47.073+0100 imported 9999 objects

Final Words

By following the official Parse migration guide and this blog post you should now have a working Parse Server. As mentionned by the Parse team, the migration will not be easy for everyone, you should conduct tests to ensure your data is consistent and your Cloud Code still work. We hope by providing a quickly deployable solution on Scalingo will help you ease the transition.

An interesting Parse alternative is the Mozilla backed Kinto that we will discuss in the second blog post tomorrow.

UPDATE: The second part is online.

Share the article
Yann Klis
Yann Klis
Yann Klis co-founded Scalingo. Scalingo's vision is to offer a european sovereign cloud housting platform for developers. Today Scalingo hosts thousands of web applications from customers located all over the world. Before that Yann founded Novelys a web studio specialised in Ruby on Rails technology.

Try Scalingo for free

30-day free trial / No credit card required / Hosted in Europe