Hello Lala,
I read this thread last month and considered replying but was on holiday at the time. Anyway, here is my (rather tardy) response.
As I am sure you know, it is quite a good idea to test any changes to your database application before applying them to your live, production system. Sometimes, even updates can cause unexpected changes, as you found out. When I saw that you had “
a clinic full of leprosy patients whose records couldn't be seen”, I thought I would share with you what I do, which could help you if have this problem in future.
The idea is to have a ‘clone’ of your nuBuilder application, running on the same platform as your live system. You can apply the update (or any other changes you want to test) to the clone and check that all is well before doing the same on the live system. To this end, I wrote a simple procedure that, with a single click, makes and exact copy of the live application (database structure, contents and all files). You can then switch over to this clone and test the update etc. Because it is identical to the original, running on the same platform, you can be confident that the test system will behave in the same way as the live one. It gives you time to resolve any issues whilst the live system can continue to be used as normal.
Here is what you would need to do:
1. Install a brand new, empty nuBuilder application on your hosting platform.
2. Using the code in
CloneDatabaseProcedure.txt, create a new procedure in your live application.
3. Using the variables from nuconfig.php file in the new, empty application, modify the procedure so that it has the correct credentials for the 'target'.
CloneDatabaseProcedure.txt
These are the lines that need to be altered.
Code: Select all
//== These are the target database parameters that need to be modified
$targetHost = "enter_your_value"; // use $nuConfigDBHost from the target installation
$targetDB = "enter_your_value"; // use $nuConfigDBName from the target installation
$targetUsername = "enter_your_value"; // use $nuConfigDBUser from the target installation
$targetPassword = "enter_your_value"; // use $nuConfigDBPassword from the target installation
$targetCharset = "enter_your_value"; // use $nuConfigDBCharacterSet from the target installation
$targetPort = 3306; // use $nuConfigDBPort from the target installation
$sourcePath = realpath(".."); // copy all files in the parent folder and below. (You can probably leave this unchanged.)
$targetPath = realpath("../../") . "/clone_directory_name"; // the target folder which will contain all of the copied files
//== end of parameters
The procedure should then be ready to run. When it completes, you should have a perfect copy of your live application. You can run it whenever you want to take a snapshot of your current live system in order to do some testing.
Finally, because the live and test versions will look identical, it is useful to have reminder of which one you are using. This works for me. Just add something like this to the
nuOnLoad() function. It will insert a “TEST VERSION” string into the breadcrumb bar, before the refresh button.
Code: Select all
function nuOnLoad() {
if (window.location.href.includes("_test")) { // look for a string that is unique to the test version's URL
$('#nuRefreshButton').append('<input id="testInfo" style="float:left; margin-right:5px; width:125px; color:red; font-weight:bold" type="button" value="-- TEST VERSION --">');
}
}
I hope this is helpful for you. Let me know if you have any questions if you decide to give it a go. . I will freely admit that this is not the most efficient and elegant code … but it does work for me.
Finally, it is really interesting to get a glimpse of how nuBuilder is being used. I hope it is making a positive contribution to your work treating leprosy.
Neil
You do not have the required permissions to view the files attached to this post.