SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2013
    Location
    Chennai, India
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transfer data from one DB Server to another using PHP

    How can I retrieve values from one database server and store them in other database server using PHP?

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,129
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mohamedismail View Post
    How can I retrieve values from one database server and store them in other database server using PHP?
    First off, please provide useful thread titles instead of meaningless ones, like "PHP Thread". That means nothing, and it won't get any interest for others to help you.

    Now with that said, you would simply connect to database server A, query your data, connect to database server B, and insert your data. But all that is useless, when you can simply perform a mysqldump from database server A and import it into database server B.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Location
    MA, USA
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What @cpradio ; said is correct.

    Easiest way is to do a mysqldump, or do an 'Export' from phpmyadmin if that's available.

    You can also fetch from one database and insert into another.

    If you plan on doing this often, you might want to google for "php database migration" and "php database synchronization". There are a few stand alone migration tools, and there are some powerful tools that include migration functionality.

    Here are some links:
    Phinx: http://phinx.org/
    Yii Tool: http://www.yiiframework.com/doc/guid...base.migration
    Propel (has built in migrations): http://propelorm.org/
    Doctrine (can add migrations): http://www.doctrine-project.org/proj...igrations.html

    Hope this get's you pointed in the right direction :-)
    jbWebWare.com - Bringing The Web To You!!!

    AllianceCMS.com - Bringing Us Together!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •