twisted1919
Administrator
Staff memberHi guys,
As promised a while back, past few weeks i have been working at an automatic upgrade mechanism for mailwizz and i want to share with you where we are.
When i started this, i thought we will use guzzle to download the update file(a .zip) from our servers then we would use zipper to unzip the archive over the existing app files which would overwrite them and that'd be it.
The part where we would download the file from our servers to the target server was working pretty fine, even if the update archive was pretty large in size, like 60mb (we ship the entire update not just the changed files so that we can allow upgrading from version 1.a.b to version 1.x.y without issues).
We did had some issues when we tried this from various servers, but nothing that couldn't be managed with nice work arounds.
After the file was downloaded, unzipping it was the problematic step.
The library we used is pretty awesome, but it took ~30 minutes to unzip the archive over the existing files and it would keep the cpu/memory load very high while doing like so. For me, even if this will run at midnight and it can take this amount of time, is still pretty unacceptable. Lots of things can happen in 30 minutes so better avoid that.
I decided that using php's exec() function we can call the native linux binaries that would do all this hard work for us. So in order for this to work, exec() must be enabled on the host. I know lots of hosting companies have this disabled, it's pretty bad, maybe it is a reason to move on a vps if you want auto-updates.
Next, we expect following linux binaries are installed on the server: curl, unzip, cp.
Most of servers will have this. If they don't, they're at one command away to be installed.
Doing some tests with the above and looking very promising, i was able to run dozen auto-updates without absolutely no issue.
We have lots of checks in place in order to make sure we don't screw things over during an update and we also try to create a backup if the Backup Manager extension is enabled, so this should work just fine for 99.99% of the cases.
However, with such things, you can never be 100% sure you won't break some customer's app, thus we will disable this feature by default and you can only enable it if you know what you're doing.
For now this is a work in progress, bottom line is since next release, we will have an automatic updater
p.s: you also get a notification email when the auto-update finishes(ignore 5th line), see:
As promised a while back, past few weeks i have been working at an automatic upgrade mechanism for mailwizz and i want to share with you where we are.
When i started this, i thought we will use guzzle to download the update file(a .zip) from our servers then we would use zipper to unzip the archive over the existing app files which would overwrite them and that'd be it.
The part where we would download the file from our servers to the target server was working pretty fine, even if the update archive was pretty large in size, like 60mb (we ship the entire update not just the changed files so that we can allow upgrading from version 1.a.b to version 1.x.y without issues).
We did had some issues when we tried this from various servers, but nothing that couldn't be managed with nice work arounds.
After the file was downloaded, unzipping it was the problematic step.
The library we used is pretty awesome, but it took ~30 minutes to unzip the archive over the existing files and it would keep the cpu/memory load very high while doing like so. For me, even if this will run at midnight and it can take this amount of time, is still pretty unacceptable. Lots of things can happen in 30 minutes so better avoid that.
I decided that using php's exec() function we can call the native linux binaries that would do all this hard work for us. So in order for this to work, exec() must be enabled on the host. I know lots of hosting companies have this disabled, it's pretty bad, maybe it is a reason to move on a vps if you want auto-updates.
Next, we expect following linux binaries are installed on the server: curl, unzip, cp.
Most of servers will have this. If they don't, they're at one command away to be installed.
Doing some tests with the above and looking very promising, i was able to run dozen auto-updates without absolutely no issue.
We have lots of checks in place in order to make sure we don't screw things over during an update and we also try to create a backup if the Backup Manager extension is enabled, so this should work just fine for 99.99% of the cases.
However, with such things, you can never be 100% sure you won't break some customer's app, thus we will disable this feature by default and you can only enable it if you know what you're doing.
For now this is a work in progress, bottom line is since next release, we will have an automatic updater
p.s: you also get a notification email when the auto-update finishes(ignore 5th line), see: