Veeam, HyperV, Vcentre, Server (2008 - 2022)
Joined
·
1,441 Posts
Hi,
Not sure where to put this.
I have two databases on the one server.
DB1 - planesp2_aircraft
table - adsb_logs
DB2 - planesp2_system
table - spotting
What I need to do is to move the contents of aircraft.adsb_logs to planesp2_system.spotting.
However the aircraft.adsb_logs only has 4 fields -
id
icao
firstSeen
lastSeen
and the destination database has a LOT more fields:
id
date
uname
location
type
registration
make
model
engine
operator
eng_make
eng_model
eng_vari
eng_num
role
config
icao
modes
ff
Secal
unotes
anotes
What I have as an example of some data from the logs table is -
so this data from this table needs to be entered as follows into the spotting table (note I am only listing the fields amended with real data the rest can be "Null" ):
id 1
date 2018-07-12
uname David
location Kirkby Radar
type Radar
registration TBC
modes 4ca683
Note that from the adsb_logs table on DB1 to the destination DB2 spotting means a few new inserts, including name, location, type and registration.
And also that the date is adjusted from 2018-07-12 13:05:56 to just "2018-07-12"
Users for each DB have access to the other.
I am guessing either a cron job or a php page from which I can kick this off manually?
Not sure where to put this.
I have two databases on the one server.
DB1 - planesp2_aircraft
table - adsb_logs
DB2 - planesp2_system
table - spotting
What I need to do is to move the contents of aircraft.adsb_logs to planesp2_system.spotting.
However the aircraft.adsb_logs only has 4 fields -
id
icao
firstSeen
lastSeen
and the destination database has a LOT more fields:
id
date
uname
location
type
registration
make
model
engine
operator
eng_make
eng_model
eng_vari
eng_num
role
config
icao
modes
ff
Secal
unotes
anotes
What I have as an example of some data from the logs table is -
Code:
1 4ca683 2018-07-12 13:05:56 2018-07-12 13:11:20
id 1
date 2018-07-12
uname David
location Kirkby Radar
type Radar
registration TBC
modes 4ca683
Note that from the adsb_logs table on DB1 to the destination DB2 spotting means a few new inserts, including name, location, type and registration.
And also that the date is adjusted from 2018-07-12 13:05:56 to just "2018-07-12"
Users for each DB have access to the other.
I am guessing either a cron job or a php page from which I can kick this off manually?