If you want to make your own I could give you some hints on the process that would be optimal ( in my opinion ) but it would require quite enough fiddling with php + cron to make it happen fully automatically.
]]>To help out a bit I can tell you the process we made at some point on a company I used to work to sync dev/production environments so it could be using a similar idea or at least give a jump start on the ‘thinking about it’ at least.
Since you want it to be automated every time a job is posted you can create a function call at the end of the form to run your scripts ( I don’t know which form / how you are using it so that is something totally up to you ).
BUT! This will eventually might get you into trouble as you could have like 2-3 forms submitted simultaneously ? So instead on every form I would say a cron job every 30 mins or 1 hour even ? To avoid conflicts and give the scripts enough time to process everything.
Eitherway what we where doing is:
Cron job to a custom php file that ->
1) Was dumping and downloading the full production sql + importing it into our local dev. When that returned an ‘ok’ -> move to 2.
2) Was using an ftp instance to sync all new files ( so it was like an incremental(?) backup lets say to our local dirs ( that was a shell script made by another co-worker so I can’t help but maybe it’s doable through php as well ).
We had that cron running 2 times a day one in the evening as it was lunch break and 1 at night since it was off-working hours, but you can adjust that.
—-
I’m a little confused on the split part of admin/front-end that you want one runs on local only etc. Shouldn’t you be ‘pushing’ the admin changed on the public non-local site as well?
—-
I don’t know how much further I could explain as there where multiple coworkers doing this so I might not know all the aspects but this was the general situation. A script that pretty much took an automated backup 2 times a day and importing it locally. That’s why I thought that maybe some plugins might even do that eitherway.
]]>In fact what i have figured out is somewhat different from what you propose. The requirement is not doing this say one or two times a day. Our HR dept. requires that EVERY TIME a job application is posted online it should update/synch the local version so that it is available to them from their admin panel on the localhost and they will do the subsequent process locally. Remember there’s no need of admin features on the online version (although they will be available there).
Now this makes it technically quite complicated, may be because of WordPress inherent structure. Let me explain what I think I may have to do:
– First I have to extend the code in the “Job Application Form” in which after normal submission the data as well as the uploaded attachments (file names only) will have to be saved into like an XML file on the server. So if there are for instance, 30 job applications a day, there will be 30 XML files for that day.
– I have to write a windows service, like in .NET/C# (I have already developed such for another purpose) which will download those ‘new’ XML files from that FTP directory from the server one by one, will scan the XML and update (in fact create a records) in the mysql db of the local version, download their respective attachments from the ftp to the local ‘uploads’ directory. This windows service will be scheduled to run say every 10-20 minutes interval, so that the HR ‘feel’ that they are working on fresh data.
This will complete the incremental backup (or whatever you call it :))
I hope you may understand now the actual constraints. If you have any suggestions to improve this design or any alternative, you are welcome.
Thanks
]]>