Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Support staff are mostly interested in the error and emergency logs, but depending on the issue the other logs may be important. The error log contains PHP exceptions, and the emergency log contains Blesta errors. Find the files with the most recent date, and open them to find the errors. If the error is reproducible and you have SSH access to the server, you can "tail" the log files while reproducing the error to more easily find what you need. For example: tail -f general-*.log will tail all of the log files at once.

Checking the integrity of your System Key and Encrypted Data

Note
titlePassphrase

If you have a passphrase set for batch processing credit cards, this utility will not work. If possible, first remove the passphrase under Settings > Company > General > Encryption.


The /config/blesta.php file contains a very important Blesta.system_key. This key is generated during installation and must match the original database. If the key is changed, all encrypted data will be irrecoverable and your installation will be permanently broken.

To check your system, follow these steps:

  1. Download the SystemKeyTest.zip file below.
  2. Unzip the file.
  3. Upload admin_keytest.php to ~/app/controllers/
  4. Visit /admin/keytest in your browser.
  5. Observe the output.

View file
nameSystemKeyTest.zip
height250

Disable Human Verification (CAPTCHA)

If you enable a Human Verification / CAPTCHA's for staff logins, and are then unable to login, you may disable Human Verification for the company using the following query. Please note that this will disable Human Verification / CAPTCHAs for the entire company. If you are using multi-company and the issue affects a company ID other than 1, update the query to replace the company ID with the desired company ID.

Code Block
languagesql
UPDATE `company_settings` SET `value` = 'a:0:{}' WHERE `company_settings`.`key` = 'captcha_enabled_forms' AND `company_settings`.`company_id` = 1;

After running this query, login to Blesta and visit Settings > Company > General > Human Verification. Adjust your settings and re-enable Human Verification / CAPTCHA's for the desired forms.

Regain Staff Access to Settings

If you edit your own staff group and lock yourself out of the staff settings area, you can regain access by adding ACL permissions to edit your staff group back manually by running the following query:

Code Block
languagesql
UPDATE acl_acl INNER JOIN acl_aco ON acl_aco.id = acl_acl.aco_id SET acl_acl.permission = 'allow' WHERE acl_aco.alias = 'admin_system_staff' AND acl_acl.action = 'editgroup' AND acl_acl.aro_id = 1;

Then, access the edit group page at the URL ~/admin/settings/system/staff/editgroup/1/ and you can grant permissions to any others that may have been erroneously removed.

Forcefully disable auto-debit for clients that do not have active services

...

Code Block
languagesql
INSERT INTO client_settings (client_settings.key, client_settings.client_id, client_settings.value) SELECT 'autodebit', `clients`.`id`, 'true' FROM `clients` LEFT JOIN `services` ON `services`.`client_id` = `clients`.`id` AND `services`.`status` = 'active' LEFT JOIN `client_settings` ON `client_settings`.`client_id` = `clients`.`id` AND `client_settings`.`key` = 'autodebit'  WHERE `services`.`id` IS NULL AND `client_settings`.`key` IS NULL;

How do I prevent a domain or service from being renewed via the module when an invoice is paid?

Sometimes, particularly with domains the domain could be renewed outside of Blesta. We recommend that you let Blesta handle these renewals automatically. If for some reason you need to prevent that from happening you will need to remove the relevant record from the service_invoices table where invoice_id=your invoice id, and service_id=your service id.

Fetch the Collation of Tables

...

Code Block
languagesql
SELECT table_collation AS collation,GROUP_CONCAT(table_name) AS tables FROM information_schema.tables WHERE table_schema='DATABASE-NAME' GROUP BY collation;

Upgrading MariaDB

The recommended requirements for Blesta 5.0+ includes MySQL 5.7.7+ or MariaDB 10.2.2+. If you are running MariaDB < 10.2.2, you can upgrade to 10.2.x using this script.

First, backup all databases.

Code Block
languagebash
mysqldump -u root -p --all-databases > all_databases.sql


On CentOS 7.x with no root password set. use "mysql_upgrade -u root -pPASSWORD" if there is a password.

Code Block
languagebash
#!/bin/bash
# Upgrade MariaDB to 10.2

# ------- REPLACE MARIADB -------
# Set up MariaDB 10.2 repo
cat >/etc/yum.repos.d/MariaDB10.repo <<EOL
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOL

# Stop MariaDB
systemctl stop mariadb

# Remove old MariaDB
yum -y remove mariadb-server mariadb mariadb-libs
yum clean all

# Install MariaDB 10.2
yum -y install MariaDB-server MariaDB-client
# UNCOMMENT IF YOUR PHP MYSQL PACKAGE IS php-mysql
#yum -y install php-mysql
systemctl enable mariadb
systemctl start mariadb
mysql_upgrade

# Re-install postfix!
# UNCOMMENT IF RUNNING VIRTUALMIN OR POSTFIX
#yum install postfix -y
#systemctl enable postfix
#systemctl start postfix

Manually Resetting Staff Password

There are a couple ways to reset your staff password, from simplest to most complex. Follow these steps in order until your password has been successfully reset:

  1. To reset the staff password visit /admin/login and click the "Reset My Password" link. Enter your username, and click the "Reset Password" button. You should get an email with a password reset link within a few minutes.
  2. If you don't get an email, ensure that your username is correct. In phpMyAdmin or other MySQL database utility, look in the users table. Your username should appear in the "username" column, typically where id equals 1, as the primary staff account is the first user to be created. Try using the password reset option above with the correct username.
  3. If that still doesn't work, you will need to temporarily enable legacy passwords.
    1. Please see Encryption in the user manual, specifically Blesta.auth_legacy_passwords and set it to true.
    2. Then, in the users table for your username, update the password field to: 5f4dcc3b5aa765d61d8327deb882cf99
    3. Then, try logging in with your username and the password password. Reset your password.
    4. Then, change Blesta.auth_legacy_passwords back to false.


Renaming a Module

In some rare cases it may be necessary to rename a 3rd party module. For example, if you are using a third party module named TestModule, and we release an official module called TestModule, you may wish to rename third party module so that it is not overwritten by the official module.

Note

Before proceeding, make sure you really need to rename the module and be sure to back up your files + database. If you encounter any issues, roll back your changes.

The first step is to rename the module directory and primary module file

  • /components/modules/testmodule becomes /components/modules/testmoduleold
  • Rename /components/modules/testmodule/testmodule.php to /components/modules/testmodule/testmoduleold.php

The second step is to  update the class name in testmoduleold.php from:

Code Block
languagephp
class Testmodule extends Module

to

Code Block
languagephp
class Testmoduleold extends Module

The third step is to update the modules database table.

Code Block
languagesql
UPDATE `modules` SET `class` = 'testmoduleold' WHERE `class` = 'testmodule';

The fourth step is to change view context statements from:

Code Block
languagephp
$this->view->setDefaultView('components' . DS . 'modules' . DS . 'testmodule' . DS)

to

Code Block
languagephp
$this->view->setDefaultView('components' . DS . 'modules' . DS . 'testmoduleold' . DS)