delete data in local database that doesnt exist in external database

1
is there a way to delete data in local base that doesnt have the same id anymore in external database ??? i need my local database and external database to be exact replica,, i try to use db connector and db replication but still doesnt find a way, please help
asked
3 answers
1

The safest way to ensure your local database is identical to your external database is to setup an identical replica of your external DB locally. Assuming by "external database" you mean the default Postgres database in the Mendix cloud, you can follow this tutorial to do so:

https://docs.mendix.com/developerportal/operate/restore-backup-locally/

If it's not Postgres, you may follow a similar approach.  

If you prefer to use database replication, please show us your setup so we can debug why it and what is currently not working.

answered
1

you can use Rest API services. 

answered
1

Could you share with us what exactly you have tried so far using the DB replication and the DB connector modules?

Without knowing anything about your specific setup and use case, it it's really like poking in the dark.  The solution to your problem really depends on a lot of things like amount of data and tables to synchronize and how the replicated data is used in your application. E.g. if it's not referenced by other entities in your Mendix app, you could use a non-persistent domain model or simply clear your current copy of the data. If it is referenced, there are a couple of different approaches to identify the outdated objects like using the list operation intersect or even running an OQL query. However, you also need to know what should happen to those referencing data. Like will they be deleted as well? Should the old reference be replaced with a new reference existing in the updated copy? Should the reference be empty? etc.

answered