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:
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.
you can use Rest API services.
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.