database-migrate-copy_banner_devzone

Today we will see how to copy/migrate database/tables from one server to another. Apart from the traditional method of exporting data from source server in .sql/.csv or other format, then
importing that back in destination server, here we will copy data on the fly. One of the advantage of using this method is, you can copy/migrate complete/partial database, like one or more tables, functions,
events etc.

To achieve this task we will use a free tool (MySQL Client) called SqlYog Community. A very powerful tool and one of my favorite. You can download it from following link:

Download SqlYog Community Edition

Steps to migrate are as follows:

i) After installation, Open SqlYog community Edition, and open source database server in one tab and destination database server in another tab, this is IMPORTANT to open both servers, shown in below image.

source-destination-server

ii) Go to Source DB server tab. You will see all the databases listed there.

iii) Right Click on database you want to migrate to Destination db server. On Context menu select “Copy Database to Different Host/Database”, shown below.

copy-database-from-one-seerver-to-another-step1

iv) On popup window, you will see Source Database Server and Target. On left hand side, with the check-boxes, select one or more tables, functions, triggers etc or all, whatever entities you want to migrate to destination server/database, shown in below image.

v) On Right hand side, select the destination server/database in which you want to copy your database.

vi) Select “Structure and Data” or “Structure only” as per your need.

vii) Click Copy Button, once the process is done, click Done button.

That’s it, quiet handy…!

———copy mysql database from one server to another———