Changes

Line 35: Line 35:  
</source>
 
</source>
 
Restart postgresql.
 
Restart postgresql.
 +
* Disable all constraint checks to allow import. For this, connect to database and run the procedure provided by Dolibarr installation:
 +
<source lang="sql">
 +
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql
 +
> select dol_util_triggerall(false);
 +
CTRL+D
 +
</source>
 
* Modify the generated export dump file to set escape characters with correct value for postgres:
 
* Modify the generated export dump file to set escape characters with correct value for postgres:
 
<source lang="bash">
 
<source lang="bash">
Line 44: Line 50:  
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql -f mysqldump_readyforpgsql.sql >resimport.log 2>&1
 
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql -f mysqldump_readyforpgsql.sql >resimport.log 2>&1
 
</source>
 
</source>
* Once import is finished, you must update all sequences to match imported data.
+
* Once import is finished, you must enable constraint check and update all sequences to match imported data.
 
<source lang="bash">
 
<source lang="bash">
 
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql
 
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql
 +
> select dol_util_triggerall(true);
 
> select rebuilt_sequences();
 
> select rebuilt_sequences();
 
CTRL+D
 
CTRL+D