The old upgrade procedure will probably be abandoned in V. 12

eugenio

Administrator
Staff member
The old upgrade procedure (upgrade.php/upgrade2.php) will probably be abandoned in V. 12. Only the more recent one (up.php / up2.php) will be maintained.

I started this thread to check if any of you are still using the old procedure and if yes, why.

Thanks!
 

ChrisG

New member
Yes... we are still using upgrade.php for upgrades.
The up.php / up2.php did not work for me with our configuration. It has been a good while since I last tried. Sorry, do not remember the details at this point.
 
Last edited:

TechSupport

New member
Hello,

We have never been able to get the 'up.php' upgrade method to work - it throws an error at phase 3/4 (unpaking the ZIP file). This is likely a file/folder permissions issue, but we have not been able to resolve this despite several attempts since the 'up.php' method was first introduced.

Consequently, we need the old manual file replacement/upgrade.php method to be continued please.

Regards...
 

dada_nes

New member
Same here ... we prefere using upgrade.php for upgrades.
The up.php / up2.php worked so and so for us. Currently, if any error comed out on the first upgrade attempt with the automatic procedure, we use the manual ones that, so far, was always working.
 

eugenio

Administrator
Staff member
Hi everybody,
the reasons behind this decision are at least two:
1) Reduce the amount of code to maintain/update for each new version
2) For V 12, the upgrade procedure needs to create a copy of some of your custom files so if you are facing problems with file copying using up/up2, you will have similar problems with upgarde/upgrade2. You can do this copy manually, but this would make the documentation and the process itself unnecessarily complicated.

Furthermore, at some point in the future, I would like to have an upgrade procedure that can start from the admin area of a DaDaBIK app, just by clicking an upgrade button (as wordpress does, for example). This will certainly use the up/up2 approach so I would like to make a step to move into that direction.

If you remember the exact problems / errors you faced, please report them here.

@deep64blue : could you share with the others what you needed to do?

Best,
 

deep64blue

DaDaBIK Guru
I usually end up applying 777 permissions to the upgrades folder, there are probably simpler solutions but that gets the job done and it's just temporary so no major issues.
 

dada_nes

New member
Our environment is in local and under windows (so no privilege problem for what I know). As we wrote sometime the automatic procedure works some other time no. When the automatic upgrade procedure fail we use the manual one that require more time for backup all the custom files generated but works for sure . The next upgrade we will try the automatic one and if any probelm I report it here. Since our application is in production we can't wait for the support so using the manual procedure make us working again without any down. The alternative put online locally the backup, test the automatic procedure, if fail writing in the forum and waiting for the answers so apply the fix (if need) then replay it to the production one. A lot of time, manual one solve the problem :).
 
Last edited:

eugenio

Administrator
Staff member
I usually end up applying 777 permissions to the upgrades folder, there are probably simpler solutions but that gets the job done and it's just temporary so no major issues.
Hello,
do you need the upgrades_xxxxxx folder created by DaDaBIK during the upgrade process or the whole DaDaBIK folder?
 

eugenio

Administrator
Staff member
The upgrades_xxxxxx folder.
How are the permissions set before you change to 777? Do you remember or could you try to reproduce a (non working) upgrade? I am trying to reproduce the issue to see if I can improve this.
 

deep64blue

DaDaBIK Guru
Hope this is helpful, may just be my setup! Have emailed some screenshots to you:-

mkdir dtest

ls -ld dtest
drwxrwxr-x 12 name name 4096 Feb 14 06:58 dtest

installed dadabik 11.11

copied up.php and up.php for v11.12

-rw-r--r-- 1 name name 11098 Nov 29 10:02 up.php
-rw-r--r-- 1 name name 999547 Nov 29 10:02 up2.php

Ran up.php
A temporary folder upgrades_65cc68a3e4acd has been created. If you want to upgrade your installation, copy the latest zip package (e.g. dadabik_xxxx_enterprise.zip) into the upgrades_65cc68a3e4acd folder without changing the file name; when you are done, click CONTINUE.

drwxr-xr-x 2 www-data www-data 4096 Feb 14 07:15 upgrades_65cc68a3e4acd
(NB: owned by www-data not my user)
cp ~/Documents/dadabik_11.12-Elba_platinum.zip ./upgrades_65cc68a3e4acd/
cp: cannot create regular file './upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum.zip': Permission denied

sudo !!

-rw-r--r-- 1 root root 22526951 Feb 14 07:19 dadabik_11.12-Elba_platinum.zip

So the directory is owned by www-data and the file by root

Error while copying file upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum/program_files/permissions_manager.php
An error occurred during the upgrade procedure, you can try to restart the procedure.

chown -R name:name ./upgrades_65cc68a3e4acd

drwxr-xr-x 3 name name 4096 Feb 14 07:21 upgrades_65cc68a3e4acd

Step 3/4 - ZIP file check, license acceptance
There are unexpected files in your upgrades folder, you should only have one zip file (plus an .htaccess file, automatically created, that might be hidden). Please fix the problem and restart the ugprade procedure. If are sure you can skip this check and want to continue with the upgrade procedure anyway, you can add a $skip_check_file_count_upgrades = 1; line to your config_custom.php and restart the upgrade procedure.

An error occurred during the upgrade procedure, you can try to restart the procedure.


rm -rf dadabik_11.12-Elba_platinum
(directory created during failed attempt)


Upgrade
Step 4/4: Files copy, Database update
I am unzipping the file upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum.zip ...

Error while unzipping the file.

An error occurred during the upgrade procedure, you can try to restart the procedure.


sudo chmod 770 dadabik_11.12-Elba_platinum.zip
-rwxrwx--- 1 name name 22526951 Feb 14 07:19 dadabik_11.12-Elba_platinum.zip

Upgrade
Step 4/4: Files copy, Database update
I am unzipping the file upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum.zip ...

Error while unzipping the file.

An error occurred during the upgrade procedure, you can try to restart the procedure.

sudo chmod -R 777 upgrades_65cc68a3e4acd
drwxrwxrwx 2 name name 4096 Feb 14 07:29 upgrades_65cc68a3e4acd
Upgrade
Error while copying file upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum/program_files/permissions_manager.php
An error occurred during the upgrade procedure, you can try to restart the procedure.


sudo chown -R www-data:www-data upgrades_65cc68a3e4acd

DaDaBIK has been correctly upgraded. After having completed all the activities listed above you can start using it. You might need to clean the cache of your browser to correctly load the latest versions of some files (e.g. CSS files and pictures).
 

eugenio

Administrator
Staff member
Hope this is helpful, may just be my setup! Have emailed some screenshots to you:-

mkdir dtest

ls -ld dtest
drwxrwxr-x 12 name name 4096 Feb 14 06:58 dtest

installed dadabik 11.11

copied up.php and up.php for v11.12

-rw-r--r-- 1 name name 11098 Nov 29 10:02 up.php
-rw-r--r-- 1 name name 999547 Nov 29 10:02 up2.php

Ran up.php
A temporary folder upgrades_65cc68a3e4acd has been created. If you want to upgrade your installation, copy the latest zip package (e.g. dadabik_xxxx_enterprise.zip) into the upgrades_65cc68a3e4acd folder without changing the file name; when you are done, click CONTINUE.

drwxr-xr-x 2 www-data www-data 4096 Feb 14 07:15 upgrades_65cc68a3e4acd
(NB: owned by www-data not my user)
cp ~/Documents/dadabik_11.12-Elba_platinum.zip ./upgrades_65cc68a3e4acd/
cp: cannot create regular file './upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum.zip': Permission denied

sudo !!

-rw-r--r-- 1 root root 22526951 Feb 14 07:19 dadabik_11.12-Elba_platinum.zip

So the directory is owned by www-data and the file by root

Error while copying file upgrades_65cc68a3e4acd/dadabik_11.12-Elba_platinum/program_files/permissions_manager.php
An error occurred during the upgrade procedure, you can try to restart the procedure.

chown -R name:name ./upgrades_65cc68a3e4acd

Hi,
I am trying to reproduce this.
Can the user Apache is running as (apparently www-data) write in your main DaDaBIK directory? According to this message, the zip file has been unzipped correctly, but then DaDaBIK could not copy the files (i.e. replacing 12.11 files with 12.12 files) from ./upgrades_65cc68a3e4acd to your main DaDaBIK. If DaDaBIK cannot write in your root DaDaBIK folder, the up2 process can't work.
I know it's not the safest way to set permissions but if you let www-data write on your DaDaBIK root folder only during the upgrade (and during the upgrade process you set a password protection on the entire site) it shouldn't be a security hazard.

Best,
 

deep64blue

DaDaBIK Guru
Apologies I meant to respond to this over the weekend.

I've been doing a bit of testing, I can give Apache write access to the dadabik root during an upgrade however my user has no access to the upgrades folder. I therefore need to use sudo to copy the zip file into that folder but I also then need to change the ownership from root to Apache.

As long as all that is done it works!
 
Top