diff --git a/nextcloud_devenv/config_db_query.sh b/nextcloud_devenv/config_db_query.sh index 140a395..61b2f6f 100644 --- a/nextcloud_devenv/config_db_query.sh +++ b/nextcloud_devenv/config_db_query.sh @@ -11,5 +11,13 @@ flavor=dev database_name=nextcloud_$flavor username=nextcloud_$flavor + +# postgres db_port=5432 db_hostname=127.0.0.1 +dbtype_nextcloude=pgsql + +# mariadb/mysql +db_port=3306 +db_hostname=127.0.0.1 +dbtype_nextcloud=mysql diff --git a/nextcloud_devenv/migrate_db_sqlite2postgres.sh b/nextcloud_devenv/migrate_db_sqlite2postgres.sh index 994e681..24c969c 100755 --- a/nextcloud_devenv/migrate_db_sqlite2postgres.sh +++ b/nextcloud_devenv/migrate_db_sqlite2postgres.sh @@ -15,10 +15,16 @@ log_info "See https://docs.nextcloud.com/server/latest/admin_manual/configuratio source ./config_db_query.sh -# convert localhost of host into container virtual brdige hostname mapping +# convert localhost of host into container virtual bridge hostname mapping #db_hostname=host.docker.internal #db_hostname=host.containers.internal # host loopback mapped address db_hostname=10.1.1.13 +# dbtype_nextcloud inherited from config_db_query -$defer ./run_occ.sh db:convert-type --password="$password" --port="$db_port" --all-apps pgsql "$username" "$db_hostname" "$database_name" +$defer ./run_occ.sh db:convert-type --password="$password" --port="$db_port" --all-apps "$dbtype_nextcloud" "$username" "$db_hostname" "$database_name" + +if [[ $dbtype_nextcloud == mysql ]] +then + $defer ./run_occ.sh config:system:set mysql.utf8mb4 --type boolean --value="true" +fi diff --git a/nextcloud_devenv/setupdatabase.sh b/nextcloud_devenv/setupdatabase.sh index cf37b46..bd09c7b 100755 --- a/nextcloud_devenv/setupdatabase.sh +++ b/nextcloud_devenv/setupdatabase.sh @@ -20,4 +20,14 @@ GRANT ALL PRIVILEGES ON SCHEMA public TO $username; EOF } | pipeto sudo -u postgres psql -f - + +{ +cat <