I want to give users the functionality of export data from one WordPress plugin installation from one site to another. A "WordPress plugin" doesn't make the difference, I'm interesting in the recommended approach to export/import data in a PHP application that has the data stored in a MySql database. The data is related to each other in database.
I'm interesting in:
- Which is the recommended format to store the data in the exported file (JSON, Xml, serialized)? Taking in care that the data is related to each other by fields in each of the MySql table, and that can be very big.
Example:
Student table has: ID, Name and Class_ID...
Class table has: ID, Description...
- Which is the recommendations to avoid specific users problems with hosting configurations that could affect the exporting or importing of large amount of data?
Example: the execution time, the max files size, the max allowed database queries
Important take in care that destination system could have already data that have the same values in the fields declared as keys, for example:
I export the Class with
ID = 5, and Description = "This is cool class"
and in the destination database could be already the Class with:
ID = 5, and Description = "This is other old class"
Where ID is the primary key in "Class" table.
Any idea around this will be appreciated. If some other information is required let me know.
Thanks in advanced.