Hey
I’m trying to move and instance of an old Parse Server in a monolithic setup to a new server with Docker & containers setup.
I’ve managed to create an instance of Parse Server, do a dump of the old MongoDB and a mongorestore on the new MongoDB container instance. This seems to work fine. I can see via a single dashboard that the new instance has the latest data and matches the old data. My idea was to then switch the domain to point at the new server, and all the live apps shouldn’t have any issues. When I do this, my dashboard shows that my new server is working with the domain switched, but when my apps try to communicate with my server, nothing happens. They both share the same masterKey, clientKey and name. I can’t work out what is going wrong.
My new server logs something like
Parse error: Invalid session token code 209.
What is that?
Oddly enough. If I login with an app pointing to my old server, I then do a dump of that server, restore.it in the new server. Manually rebuild the app with the new server URL built in, there’s no problems.
It seems that as soon as I fully change the DNS to update servers, I get that session issue. I don’t fully understand what exactly is causing this.
It is probably due to the DNS propagation. I’d do the following steps:
- Dump/Restore the old the database to the new one
- Change both old and new servers to connect to the new database
- Switch the domain to the new server
So both the clients that have already updated the DNS and the ones that haven’t yet will turn out using the same database.
1 Like
Thanks you @davimacedo.
I will try that. Is there any documentation around migrations. I.e. not Parse Apps to Parse Server to similar things that I’m trying to achieve?
I’ve only just noticed it probably wouldn’t be that easy. I keep finding that my MongoDB is hacked whenever I leave it exposed. I’m currently using revise proxies to ensure my MongoDB is only communicated with locally. In this case, my old Parse Server instance is on another server.
I’m not aware of any documentation regarding general migrations. In terms of Mongo, make sure you have some firewall in place just allowing income connections from both Parse Servers (old and new). Also make sure that it only allows authenticated users and ssl connections.
Thanks for your help! It was down to DNS propagation… Pointing both servers to one MongoDB worked well. Thank you for your help.