Cases show in web apps but not in data export

Just trying to troubleshoot our local development install has been out of sync with the data between data export/reasign case and the web app screens.

All cases from the mobile will show in web apps as expected but If i want to export case data from the same user the record numbers are not aligned. way low. Same goes for the case re assignment screen as the total number of cases are not showing up.

How do I get the databases to re sync?

I had to rebuild the ES index for users but that was the only change to this environment

anything come to mind? I have a lot of development projects on this box and do not want to loose the work done…

Web apps hits a “restore” endpoint which pulls data directly from the primary databases. Data exports and reports pull data from elasticsearch, which is used as a secondary, reporting database.

Are you running pillowtop locally ($ ./ run_ptop --all)? That service syncs database changes to elasticsearch. You can also do a full rebuild of a particular elasticsearch index. Here’s how to do that for forms and cases, assuming you’re on the sql backend.

$ ./ ptop_reindexer_v2 sql-form --reset

$ ./ ptop_reindexer_v2 sql-case --reset

Run those same commands with “form” and “case” if you have an older project that’s still using the couch backend.

Thanks for the reply, yep still an older version two years old now but still working for test bed. I am going to be deploying a new local server instance soon…looks like i have to do some reading. was not aware that couch was updated with a new database back end…interesting.

We’ve been moving forms and cases off of couch, into postgres, though we still have many other database models in couch (applications and users, for instance). The couch backend for forms and cases is still supported though, so you should be able to continue using it locally. There’s also a management command “migrate_domain_from_couch_to_sql” that you can try if you want to convert your data to the new backend.