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
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:
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:
- Click on the Deploy to Scalingo button.
- Give your future Parse instance a name.
- 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.
- 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 email@example.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.
- Clone the parse-server-example project and change directory to it.
- Create an app on Scalingo:
scalingo create my-parse
- Add the Scalingo MongoDB addon:
scalingo addons-add scalingo-mongodb free
- Setup MongoDB connection string:
scalingo env-set DATABASE_URI='$SCALINGO_MONGO_URL'
- 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
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:
- Go to the new Parse Dashboard > App Settings > General, and click on Export Data.
- Wait for the email containing the link to download exported data.
- Change directory to your Parse Server project
- 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'
- Prepare downloaded files by deleting the
}that wrap the array containing your collection data.
- Import each collection with the following command and change the options accordingly (
--password). To find out the password to your database you can use the command
scalingo 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
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.