Techniques for migrating data in a database include identifying an update to one or more data entries of a source table; determining that a status of a trigger associated with the source table indicates to update a logging table, and in response: updating, in a first transaction, (i) the one or more data entries of the source table, and (ii) one or more data entries of the logging table based on the user input, and copying content of the source table to a target table; and determining that the status indicates to update the target table, and in response: updating, in a second transaction, (i) the one or more data entries of the source table and (ii) one or more data entries of the target table based on the user input, and updating the content of the target table based on the one or more data entries of the logging table.