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
780ff41bc8
commit
c0be550b10
2 changed files with 8 additions and 3 deletions
5
conf/mysql-to-pg.conf
Normal file
5
conf/mysql-to-pg.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
LOAD DATABASE
|
||||
FROM mysql://mattermost:$mysql_db_pwd@localhost:3306/mattermost
|
||||
INTO postgresql://mattermost:$postgres_db_pwd@localhost:5432/mattermost
|
||||
WITH data only
|
||||
;
|
|
@ -188,11 +188,11 @@ if mysqlshow | grep -q "^| $db_name "; then
|
|||
postgres_db_pwd=$(ynh_string_random --length=24)
|
||||
ynh_app_setting_set --app=$app --key=postgres_db_pwd --value=$postgres_db_pwd
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_create_user $db_user $postgres_db_pwd
|
||||
ynh_psql_execute_as_root --sql="CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE template0 OWNER $db_user"
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$postgres_db_pwd
|
||||
|
||||
# Migrating from MySQL to PostgreSQL
|
||||
pgloader mysql://$db_user:$mysql_db_pwd@localhost:3306/$db_name postgresql://$db_user:$postgres_db_pwd@localhost:5432/$db_name
|
||||
pgloader ../conf/mysql-to-pg.conf
|
||||
|
||||
# Removinging MySQL database
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue