MySQL Forums
Forum List  »  Newbie

moving rows between servers
Posted by: leandro roggerone
Date: November 06, 2017 11:51AM

Hello , I would like to ask for the propper way to achieve following action.
move especific column and rows between servers.
Currently im doing this:
1st create table if not exist on target server.
2nd Dump all the schema selecting the rows I want using a where clause.
For this I use mysqldum and pipe:

mysqldump -u root -pPASSS my_db local_table --where "time < '2017-01-01 23:59:59' | mysql -u dumper -h [remote_ip] -pPASS my_remote_db

3rd On the tarjet server , rename table.
4th On the tarjet server , remove the unwanted columns.
5th On the tarjet server rename de remainig columns.

I achieve this goal using 5 different scripts.
I wonder if is posible to do all this using only mysqldump or less scripts.

Options: ReplyQuote


Subject
Written By
Posted
moving rows between servers
November 06, 2017 11:51AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.