mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
Fix
This commit is contained in:
parent
c0be550b10
commit
05b817c6b6
2 changed files with 9 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
LOAD DATABASE
|
||||
FROM mysql://mattermost:$mysql_db_pwd@localhost:3306/mattermost
|
||||
INTO postgresql://mattermost:$postgres_db_pwd@localhost:5432/mattermost
|
||||
FROM mysql://mattermost:__MYSQL_DB_PWD__@localhost:3306/mattermost
|
||||
INTO postgresql://mattermost:__DB_PWD__@localhost:5432/mattermost
|
||||
WITH data only
|
||||
;
|
||||
|
|
|
@ -185,20 +185,22 @@ if mysqlshow | grep -q "^| $db_name "; then
|
|||
|
||||
mysql_db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
|
||||
postgres_db_pwd=$(ynh_string_random --length=24)
|
||||
ynh_app_setting_set --app=$app --key=postgres_db_pwd --value=$postgres_db_pwd
|
||||
db_pwd=$(ynh_string_random --length=24)
|
||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$postgres_db_pwd
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
|
||||
tmpdir="$(mktemp -d)"
|
||||
ynh_add_config --template="../conf/mysql-to-pg.conf" --destination="$tmpdir/mysql-to-pg.conf"
|
||||
# Migrating from MySQL to PostgreSQL
|
||||
pgloader ../conf/mysql-to-pg.conf
|
||||
pgloader $tmpdir/mysql-to-pg.conf
|
||||
|
||||
# Removinging MySQL database
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
|
||||
smtp_user_pwd=$(ynh_string_random --length=24)
|
||||
url=https://$domain$path_url
|
||||
$postgres_db_pwd=$db_pwd
|
||||
ynh_add_config --template="../conf/config.json" --destination="$final_path/config/config.json"
|
||||
|
||||
chmod 400 "$final_path/config/config.json"
|
||||
|
|
Loading…
Reference in a new issue