I have moved/migrated a Central instance to a new server (keeping the same hostname, domain, etc.) following this:
and it almost work 100%. The one thing that does not seems to work are web forms/enketo: the link to forms work... the page seems to load but ultimately fails with an error message.
The difference between the two servers is that the new one id behind a reverse proxy, so when re-bulding I also took into account
The weird thing is that if I do a fresh/clean install on this new server, then the web forms/enketo also work fine, so I guess that it must be something about the existing files/configs being moved/copied to a new server.
The issue is probably with the redis cache that enketo is using?
This other post is about someone migrating to a new server with a new domain following one of two approaches (a) moving an entire snapshot of the machine or [recommended!] or (b) cloning the database and cloning some other necessary data storage, which also includes the redis data.
It sounds like you did something closer to (a), and since the domain name didn't change, I would have expected it to work. The fact that it mostly worked except for Enketo, makes me think that the Redis data didn't get transferred.
Here are some more clues about moving Redis data over:
If you want to just check what is inside redis on your old server vs. your new server, you could do this:
~/central# docker exec -it central-enketo_redis_main-1 redis-cli -p 6379
127.0.0.1:6379> keys *
1) (i have a list of keys here)
2) ...
3) ...
Do you need the same exact Enketo links to still work?
If you create a new form, do the new Enketo links for that form work? (This will let us know that Enketo is otherwise set up correctly.)
If you need the old links to work, then let's continue down this path! (If you can use new Enketo links and redistribute them, then you could actually stop here and just republish your form to get Central to make new Enketo links.)
Assuming the problem is with Redis, you need to copy the Redis database from one machine to the other following the steps in the forum post comment by Yaw linked above.
There are two parts to the Redis database, the "main" part and the "cache" part. My guess is you only need to copy the main part? The cache looks like it holds form attachments and types of things that could easily be filled in again, while the main set of keys are what make the Enketo links function.
P.S. This complexity of Enketo is one of the reasons ODK has been exploring a new Web Forms solution.
@ktuite Thanks again for continuing help me on this matter.
No I don't
I haven't tried with a new form, but I tried to create a new link for an existing form, and it doesn't work (and remember that on the same server/setup, a fresh installation of central all works as expected). I will try with a new form.
As said I would not mind old links to work, but at this point this is no mandatory/blocking. New links for existing forms do not work.
If Enketo isn't working for any forms, even new ones, then it sounds like there's a bigger issue with Enketo and how it is set up beyond the Redis DB. (I probably should have started by assuming that, since you did sync the entire machine.)
What kinds of Enketo problems are you seeing? If you go to https://<your central domain>/-/ with a hyphen, what do you see?
I checked this, there are the same keys on both severs.
On the new server I made an upgrade to the latest version of central, a re-build of the containers was giving me hope... but nothing, the result is the same.
@Matheus_Guedes what method did you use to migrate? This message from you is very worrying for me, I just migrated my server and decommissioned the old one... If the new one stops to work I will be in trouble.
As you said subsequent restarts worked, i restarted the VM and the previews started working again.
The weirdest part is that users could submit using the odk-collect app, nothing stalled down that pipeline, but edits and previews were completely broken.
Now after the restart, everything is up and running again.