@chienquang: you could put the modxDBServer into /usr/local/bin on your testing/staging server, then edit /etc/rc.local (if you have one), adding:
/usr/local/bin/modxDBServer/startModxDBServer.sh
The only thing you should need to do to start the server is to run the modxDBServer/startModxDBServer.sh script. PID files are just used to keep track of the process id. It allows the script to terminate a running process if it is invoked several times (basically just for housekeeping). You don’t need to create them manually. Just make sure that the directory they go into is writeable by root (which it should be). /var/run is the standard location for pid files on Fedora/Centos/Red Hat systems.
Once you’ve configured modxDBServer (by editing server.properties.inc.php), and any firewalls that are in the way, you should be able to use modxDBClient on another machine. You’ll need to edit client.properties.inc.php, and the server name and port in modxDBClient (these should really be settings in the config file too). Again, you may need to edit firewalls to allow connections on port 2001 (unless you change the default port) on the staging box.
Then, you should be able to create new docs/chunks/snippets on with a call like:
modxDBClient createDocument local-db-name 10
where 10 is the id of the parent document to use, and local-db-name corresponds to an entry in the client.properties.inc.php file.
This will create a stub document in the production db and dev db. You can then edit the stub on development, and update the content on production by using a REPLACE INTO ... statement.
i’ve developed several more tools for version controlling and deploying database schema changes, and also for automatically deploying and version controlling documents/chunks/snippets, etc. Hopefully i’ll get some time at some point and be able to release a full suite of tools in the next couple of months.
also, don’t forget to install the dumpDBs script onto your production server, and set it up so it runs every day (or night) if you want to be able to download a stripped down copy of the production db. My other tools will explain why you’d want to do this if it’s unclear...
@charliez:
* i haven’t used this on virtual servers, and don’t have much experience with them. For the system to work, it relies on the client being able to connect to an instance of modxDBServer.
* i’ve put svn on the test/staging server because it made no sense to use another machine for me.
* as for extending it to work with more than 2 servers, if you wanted your production clone to be a true clone, could you use replication? then i suppose that if modxDBServer connected to the master, its changes should filter down to the clone too. Alternatively, as long as you can establish a db connection to the databases you want to modify, you should be able to alter the code to make it update several databases as you want.