How can i synchronize two database tables with PHP?

后端 未结 8 637
萌比男神i
萌比男神i 2021-01-01 04:56

I need to use PHP to copy data from one MySQL database to another.

I can build and array of all the values to go into the other database but first I want to make su

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 05:29

    This is a very complex task and as far as I know many have tried to solved it so far (unfortunately I am not aware of any 100% guaranteed solution).

    I'd say that before jumping to implement your own solution you should take a look and read about the challenges you'll be facing by reading about Schema evolution, Schema Refactoring, Schema versioning, etc.

    Afterwards, you can take a look at PHP MDB2_Schema (some more documentation in this article).

    If you are not tied to PHP then you may also take a look at Sundog which provides a set of advanced schema refactorings.

    Once you get a reliable schema migration tool for your app, migrating data will be just a trivial task.

    ./alex

提交回复
热议问题