We have a MySQl database for a blood donation software that is hosted in a local server.
We do blood collection campaigns outside the blood donations center in far locations.
The idea is to have 2 databases : one central and one in a laptop for the campaigns, once finished we import the info from the laptop to the local server.
the database consists mainly of 2 tables : donors and donations (one donor can have multiple donations) with primary keys being Auto incremented.
let’s say, the local server has a database like this:
And let’s say we did a blood collection campaign and inserted data like this:
How do i copy data from the laptop database to the server’s database while maintaining relationships between the donors an their donations?
the idea is to copy the donors from the laptop to the server database (New Donor_ID would be generated cause it’s AI) then copy the donations related to the donors and update the Donor_ID in the donations table with the new generated one.
How can i achieve this please.
Thank you in advance.