Skip to content
CWPControl Web PanelDocumentation

Updating

Updated

New versions of CWP Billing are free while your license is active. The admin area shows when a new version is available, and installs it with one click.

Where to find it: License and version in the left menu.

One-click update

  1. Open License and version. When a new version is offered, the Updates box shows Update to … now.
  2. Click it and keep the page open for a minute. The billing then:
    • downloads the package and checks it against the checksum that the license server signs. A changed or damaged package is refused;
    • backs up the installation files and the whole database to storage/backups/. The 3 newest backups are kept;
    • installs the new files. config/ and storage/ are never touched;
    • applies the database changes.
  3. The page shows the result and the names of the backups.

If a step fails, the billing puts the previous files back and tells you where the database backup is.

From the command line:

php bin/console update --check   # shows what is offered
php bin/console update           # installs it

Automatic patch updates: tick Install patch releases automatically in the Updates box. The cron then installs patch releases at night, for example 1.0.6 → 1.0.7, and e-mails the administrators. Bigger versions, for example 1.1, always wait for the button.

Requirements:

  • the PHP extensions zip and curl;
  • the web server user must be able to write the installation files. That is the case on CWP, cPanel and any server where PHP runs as the account user.

If something is missing, the Updates box says what, and you update by hand.

Update by hand

  1. Back up the database and the installation folder, above all config/config.php (it holds the app key) and storage/.
  2. Download the new version from your client area and unpack it over the old installation, as the account user:
cd /home/user
unzip -o cwp-billing-v1.xx.zip -d billing

config/ and storage/ are kept. The package contains no config.php, so yours is never overwritten.

  1. Fix the permissions if you unpacked as root:
chown -R user:user billing
find billing -perm /022 -exec chmod go-w {} +
  1. Apply the database updates: a notice in the admin area links to License and version → Apply database updates. On the command line:
php bin/console migrate
  1. If you use your own theme, run php bin/console theme:publish. Then compare your overridden templates in themes/<name>/views/ with the new views/ files.

Restore a backup

  • Files: copy the folder storage/backups/files-<version>-<date>/ over the installation.
  • Database: zcat storage/backups/database-<version>-<date>.sql.gz | mysql <database>

Common problems

ProblemCause and solution
No Update now button, only a download linkThe license server offers this version without a signed checksum yet, or your license is not active. Click Check now, or update by hand.
The web server user cannot write …PHP runs as another user than the owner of the files. Update by hand, or change the ownership of the files to the PHP user.
The PHP extension zip is missingInstall or enable the zip extension for the PHP version of the domain.
HTTP 500 after a manual updateFile permissions: PHP files that the group can write are refused under suPHP. Run the find … chmod go-w command above.
Database update neededRun Apply database updates or php bin/console migrate.

Related