Jump to content

Copy content from one db to external db


mikedk

Recommended Posts

(Posted this in the MySQL section, but i think the php section might be the proper place)

 

I have a webshop db where i want to export some things linke order information to another external db on another server etc.

Example of things to move:

Table1
- orderid
- orderdate
Table2
- adress
- shippingmethod

I ONLY want it to export and import things that is not currently there.

How can this be done in a php script?

 

Link to comment
https://forums.phpfreaks.com/topic/292285-copy-content-from-one-db-to-external-db/
Share on other sites

Sorry I don't have any answers for you. I just wanted to let you (and anyone looking this topic) know that I hid your other topic under the MySQL section. Having duplicate topics can cause confusion among those responding. Especially if both topics get responses.  :happy-04:

Depends on the volume exported

 

1000 or less

  • read from server1 table
  • store in array
  • connect to second server
  • insert from the array

 

more than 1000

  • read from server1 table
  • write to a csv file
  • connect to second server
  • use LOAD DATA INFILE to insert records

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.