Best way to pull database from website?

Caporegime
Joined
12 Mar 2004
Posts
29,919
Location
England
A clients wordpress website currently has an application form on it (jetpack) which when completed sends an email with the entered details to the business.

I want to instead have this data automatically sent to a local database at the business site. What is the best way to go about doing this?

I was thinking, have the web server put responses into a local mysql database and then retrieve this data and then insert it into the database that is running at the business site.

I was thinking of writing a simple Java app that connects to the remote mysql database reads the data from it and then inserts it into the local database. Is this a reasonable approach? Or are there better ways of doing this with plugins and apps? Any advice would be greatly appreciated here, thanks. :)
 
Maybe transfer the form from Jetpack to Contact Form 7 and install the additional Plugin Contact Form DB

This will still email but also save all submissions to the database.

If you are comfortable with Java then any other language why not, But I would possibly just write a script that sits behind the site and connects directly to the other server and inserts new records, Get it running on a cron every 5mins.
 
Maybe transfer the form from Jetpack to Contact Form 7 and install the additional Plugin Contact Form DB

This will still email but also save all submissions to the database.

If you are comfortable with Java then any other language why not, But I would possibly just write a script that sits behind the site and connects directly to the other server and inserts new records, Get it running on a cron every 5mins.


Yeah I was looking into contact form db and it does seem like a viable way of doing things. My only concern with the 2nd method you mention with the script was potentially sql injection, can that effectively be filtered out that way?

Have you considered the security implications of your database being directly accessible via the web ? If you can connect, so can hackers - or are you using some sort of IP whitelisting on the server side ?

The web server only allows the ip address of the business server to connect to it.
 
Last edited:
The web server only allows the ip address of the business server to connect to it.

Good stuff, I had to ask the question.

If you're happy with writing java then its as good an approach as any. Find all rows on the server whose datestamp is later than the latest currently on the business server and insert them to the business server.

Alternative would be some of sync utility or automated replication provided by the database itself. MySQL and Oracle both have this.
 
Back
Top Bottom