mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
Cleaning
This commit is contained in:
parent
7cc2f8842b
commit
c65dbfa3e8
2 changed files with 2 additions and 9 deletions
|
@ -1,4 +0,0 @@
|
|||
LOAD DATABASE
|
||||
FROM mysql://mattermost:__MYSQL_DB_PWD__@localhost:3306/mattermost
|
||||
INTO postgresql://mattermost:__DB_PWD__@localhost:5432/mattermost
|
||||
;
|
|
@ -24,17 +24,14 @@ mysql-to-pg() {
|
|||
ynh_psql_test_if_first_run
|
||||
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 $tmpdir/mysql-to-pg.conf
|
||||
|
||||
pgloader mysql://mattermost:$mysql_db_pwd@localhost:3306/mattermost postgresql://mattermost:$db_pwd@localhost:5432/mattermost
|
||||
|
||||
ynh_replace_string --match_string="\(\"DriverName\" *: \).*," --replace_string="\"DriverName\": \"postgres\"", --target_file="$final_path/config/config.json"
|
||||
ynh_replace_string --match_string="\(\"DataSource\" *: \).*," --replace_string="\"DataSource\": \"postgres://$db_user:$db_pwd@localhost:5432/$db_name?sslmode=disable&connect_timeout=10\"", --target_file="$final_path/config/config.json"
|
||||
|
||||
# Removinging MySQL database
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
|
||||
else
|
||||
ynh_print_info --message="No migration needed"
|
||||
|
|
Loading…
Reference in a new issue