Performing a mysqldump before running sql_upgrade.php?

I am wondering if the sql_upgrade script should automatically perform a sqldump and backup the live database before running. Maybe forcing the backup isn’t the greatest idea, but I imagine giving the end-user the ability to back up the database without having to manually do it. What are your thoughts about that?

@growlingflea
If I follow your logic, the question you pose is how far do we go for the lay person to be able to do professional maneuvers.
In all the documentation, it always preached to backup your database before doing any of the upgrades or changes to one’s database in general.
By course, everyone should have at the least a nightly SQL backup of the database for recovery purposes. It is more a question how far do we go to keep people from injuring themselves.
At first, it sounds like a good idea but then the first I can think is people are going to ask where did the backup go? Then, how do I get to it if some went wrong? Then there would have to be new processes built to track the backup and which backup to restore. Oh no! there is more than one backup because someone ran the sql_upgrade more than once.
There is already a built-in backup feature in the administrations -> backup section that works well in Windows and Linux. A person can jump over there, hit the backup before running the sql_upgrade and know where the backup is in the case of emergency.
I learned all this the hard way. I hope this inspires people to do it the easy way.

This is really for developers to make us more efficient and prevent us from making errors while we are doing work. I know very few, well probably zero customers, who have ever used the sql_upgrade script. I think it would make the work-flow more logical.

If that is the case then you guys can build whatever processes you need to do your work.

Curious as to why use IIS over apache and are you using SQL Server as well?

Hi @growlingflea and @juggernautsei ,

Both the sql_upgrade.php and sql_patch.php mechanism have followed the path of least resistance and avoided anything that is operating system specific. That being said, would be really nice to spruce up these mechanisms and make them turnkey and fail safe. Note the ubuntu openemr package does actually backup up openemr (and places it in tmp directory) before it does an upgrade (which is turnkey); supporting this package takes significant effort though, which will also be the case in supporting more turnkey upgrade mechanisms in other operating systems.

-brady

btw, here’s the link to the ubuntu openemr package (note this one is for php7+):
install:
http://www.open-emr.org/wiki/index.php/OpenEMR_5.0.0_Ubuntu-Debian_Package_Installation_with_PHP7
upgrade:
http://www.open-emr.org/wiki/index.php/Ubuntu_Package_Upgrade_to_5.0.0_with_PHP7