This is actually not the most common usage case for Parse Server (connecting it to a legacy database) and that’s why you can’t find so much information about it. Anyway, I think it can be done. I’ve never tried it before to be very honest, but here’s what I’d do:
- Backup of the current data
- Launch a Parse Server connecting to the database. In order to use the Postgres storage adapter, please take a look here (you just need to pass a valid Postgres URI in the databaseURI option when initializing Parse server
–> If you had a small database, I’d suggested here to basically write a script to read the data from each of your tables and insert in Parse Server through the API. Below is another suggestion. Maybe you can use the suggestion below for big tables, and insert through the Parse API small tables.
- Launch a Parse Dashboard connecting to this Parse Server
- Use the Parse Dashboard browser to create a new schema for each of the tables you have
- Use the Parse Dashboard API console to test each of the tables. You will find some problems here and you will need to fix one by one. Here it goes some issues that I think can arise:
- objectID: I don’t know your database tables’ id format, but you will probably need to make it compatible to Parse.
- createdAt and updatedAt: You will probably need to create these two columns for each of your tables.
- other field types: You will have to make sure that you are selecting the right types when creating your schema in Parse to be compatible with the data you already have.
If possible, please update your progress on this. This is something that can be interesting for the community and maybe generate new features ideas.