Skip to main content

Logo Dolibarr

About

Dolibarr is an open source ERP & CRM for business.

Sync users

Users are synced from Cloudron to Dolibarr every hour. Sync manually by running /app/pkg/sync-users.sh using the Web Terminal.

Manual utf8mb4 migration

If your database was created with an older charset/collation, you can convert all tables to utf8mb4 from the Web Terminal.

warning

Create a Cloudron backup before running this.

#!/usr/bin/env bash
set -euo pipefail

export MYSQL_PWD="$CLOUDRON_MYSQL_PASSWORD"
DB="$CLOUDRON_MYSQL_DATABASE"
MYSQL=(mysql -h "$CLOUDRON_MYSQL_HOST" -P "$CLOUDRON_MYSQL_PORT" -u "$CLOUDRON_MYSQL_USERNAME" "$DB")

# Set database default charset/collation for future tables
"${MYSQL[@]}" -e "ALTER DATABASE \`$DB\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# Disable FK checks during bulk conversion
"${MYSQL[@]}" -e "SET FOREIGN_KEY_CHECKS=0;"

# Convert all existing base tables
"${MYSQL[@]}" -N -e "
SELECT CONCAT(
'ALTER TABLE \`', table_name,
'\` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
)
FROM information_schema.tables
WHERE table_schema = DATABASE()
AND table_type = 'BASE TABLE';
" | "${MYSQL[@]}"

# Re-enable FK checks
"${MYSQL[@]}" -e "SET FOREIGN_KEY_CHECKS=1;"