How to upgrade from 2.8.4 to 4.3.0?

Hi everyone!

I have an app that uses Parse Server 2.8.4… because it is too outdated, I want to upgrade it to the latest version. How exactly do I do that? I have no idea what I need to do!

I also understand that many things have changed since the version I’ve got. Is the structure now also different?

Could someone guide me through this?

We offer a Parse Server Migration Guide that should offer a good first read when looking at how to migrate.

For most deployments, the main work is refactoring Cloud Code. Parse Server moved away from chained JavaScript promises to async/await. In addition to the guide mentioned above, there are numerous resources available online about how JavaScript async/await works and what to consider.

Then there may be some changes in terms of APIs and methods, which usually make up the smaller part of the migration effort.

In general, we suggest to take a look at the change log from the current version (2.8.4) up to the target version (4.3.0) to see what which changes may impact your deployment specifically.

2 Likes

Hello @mtrezza and thank you for responding!

I checked the migration guide and it does explain how to migrate the cloud code… how do I upgrade the actual Parse Server though?

After parse server v3, cloud code has a new syntax. You need to refractor your cloud code. Also I assume your mongodb database version is also old. You may need to upadte mongodb version to newer version

1 Like

I checked it and I have Nodejs v8.12.0 and MongoDB v4.0.2. I think it’s ok, right?

Yes you should be fine.

Minimum mongodb version for parse is 3.6 (see docs)

But if you can update nodejs to 12 it would be be better I guess. I’m using node12 with parse 4.2.0 and 4.3.0. And works just fine

1 Like

It depends on your deployment. If you look at the parse server example, you would follow these steps:

  1. In package.json change dependencies.parse-server to 4.3.0.
  2. Delete package-lock.json and node_modules folder.
  3. Run npm install.
  4. Run / deploy Parse Server as you usually would.
2 Likes

Among other logs, I got this;

> [email protected] install /root/test-parse-server-example/node_modules/kerberos

> (node-gyp rebuild) || (exit 0)

make: Entering directory '/root/test-parse-server-example/node_modules/kerberos/build'

CXX(target) Release/obj.target/kerberos/lib/kerberos.o

In file included from **../lib/kerberos.cc:1:0** :

**../lib/kerberos.h:5:10:** **fatal error:** gssapi/gssapi.h: No such file or directory

#include **<gssapi/gssapi.h>**

**^~~~~~~~~~~~~~~~~**

compilation terminated.

kerberos.target.mk:105: recipe for target 'Release/obj.target/kerberos/lib/kerberos.o' failed

make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1

make: Leaving directory '/root/test-parse-server-example/node_modules/kerberos/build'

gyp ERR! build error

gyp ERR! stack Error: `make` failed with exit code: 2

gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)

gyp ERR! stack at emitTwo (events.js:126:13)

gyp ERR! stack at ChildProcess.emit (events.js:214:7)

gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

gyp ERR! System Linux 4.15.0-72-generic

gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! cwd /root/test-parse-server-example/node_modules/kerberos

gyp ERR! node -v v8.12.0

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok

Should I be worried or is it expected?