#DB Copier Copy your data from one MySQL database table to another by columns, that has different names or structure
One time I faced with problem to transfer data from one MySQL database to another that has absolutely different structures, but not data. It was need to do it manually controlled, so I wrote this script to do it a bit easier.
####How to use
- Copy
config.php
,copy.php
,index.php
,query.php
to any folder on your site (Eg: yoursite.com/copier) - Edit config.php with credential of DB user, that has privileges for both databases.
- Run script http://yoursite.com/copier
- Choose source and destination DBs.
- Choose source and destination tables.
- Choose columns in tables you would like to transfer from one table to another. You should add the same quantity of rows with similar types.
- Click Copy button. If data copied successfully you will get a message about how many records inserted, otherwise error description with SQL statement.
- After copying data remove folder /copier from the site to avoid vulnerability.
####Disclaimer Script doesn't care about your input errors, SQL-injections or something like that, also you have to understand what you do and why. It's just simple interface for "copy-paste" data from one table to another, that encapsulates ordinary INSERT SELECT query.