Upgrade from 7.3.1 to 7.4.3 fails [fatal rename failure]

Hi,

I just tried to upgrade our SuiteCRM from version 7.3.1 to 7.4.3, but in the last step an error occurs:

PHP Fatal error: sugar_file_put_contents_atomic() : fatal rename failure ‘/tmp/temp25rbWi’ -> ‘cache/modules/AOD_Index/AOD_Indexvardefs.php’ in /var/www/html/suitecrm/include/utils/sugar_file_utils.php on line 194, referer: http://121.40.228.135:4000/suitecrm/index.php?action=ajaxui

The last output on the screen is the following:

Adding for Leads
Adding for Cases
Adding for Bugs
Adding for ProspectLists
Adding for Prospects
Adding for Project
Adding for ProjectTask
Adding for Campaigns
Adding for EmailMarketing
Adding for Users

As a result of the error all my accounts, invoices, etc are gone. Luckily I made a backup before I started my upgrade attempt (code and DB).

Any ideas on why the upgrade fails? All pre-checks succeed and I set all permissions according to the installation guide.

Fixed the the issue, using my backup, by executing the permission commands after each individual step in the upgrade process:

sudo chown -R www-data:www-data .

sudo chmod -R 755 .

sudo chmod -R 775 cache custom modules themes data upload config_override.php