0
votes

I am working on a Wordpress site using the "Event Organiser" plugin. The plugin creates a wp_eo_events table in which info for events are stored. Here's the structure: wp_eo_events structure

The problem is: the client's old site was always a Wordpress site, but it was using a custom theme and meta_key and meta_value to store event data. So, after importing the old posts to the new site, I have my wp_postmeta table populated by records like these:

wp_postmeta structure

What I'd like to do, then, is to copy the values marked by the '_eventorganiser_schedule_start' meta_key to the 'StartDate' and 'EndDate' columns in the 'wp_eo_events' table... and to do so also with the other meta_key I'm interested in('wpl_event_time', which should go to the 'StartTime' and 'EndTime' columns) All, of course, keeping the correspondance with the post_id and event_id...

Am I asking too much?

1
Have you asked the plugin developer for assistance? Do you want this to be a one-time conversion? Or a feature of the plugin? Does the plugin have an "import" feature, for which you could write a file?O. Jones
I'd just need it to be a one-time conversion, I was thinking directly in SQL.user2014618

1 Answers

0
votes

ok, I got it!

first I made:

INSERT INTO wp_eo_events (post_id, StartDate)
SELECT post_id, meta_value FROM wp_postmeta
WHERE meta_key = _eventorganiser_schedule_start

so all the events where copied to the new table. Then I needed to insert the missing data

UPDATE wp_eo_events
SET EndDate = StartDate, StartTime = '21:30:00', EndTime '23:30:00'

Note that, since I just need the event date, I put an arbitrary start/finish time.