Data Migration
Reminder
Please ensure the target server has the database installed before migrating data.
Migrate Database
Notes
The database password can be viewed in the configuration file at the following path, with the configuration item being spring.datasource.druid.password.
cat {informat-installation-directory}/instance/informat-account/application.ymlBack Up Database
Back Up account Database
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_account_prd > db_informat2_account_prd.sqlBack Up biz Database
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_biz_prd_0 > db_informat2_biz_prd_0.sqlTransfer Backup Files to Target Server
scp [file-path] [target-server-login-account]@[target-server-IP]:[target-server-path]Restore Backup
Notes
Please ensure there are no active connections to the database
Rename Databases on Target Server (If Corresponding Databases Exist on Target)
ALTER DATABASE db_informat2_account_prd RENAME TO db_informat2_account_prd_bak;
ALTER DATABASE db_informat2_biz_prd_0 RENAME TO db_informat2_biz_prd_0_bak;Create New Databases
/usr/local/pgsql/bin/psql -d postgres -U postgres -c 'create database db_informat2_account_prd';
/usr/local/pgsql/bin/psql -d postgres -U postgres -c 'create database db_informat2_biz_prd_0';
/usr/local/pgsql/bin/psql -d postgres -U postgres -d db_informat2_biz_prd_0 -c 'create extension ltree';Restore Data
/usr/local/pgsql/bin/psql -U postgres -d db_informat2_account_prd -f /db_informat2_account_prd.sql
/usr/local/pgsql/bin/psql -U postgres -d db_informat2_biz_prd_0 -f /db_informat2_biz_prd_0.sqlNotes
- After restoration is complete, you need to restart the Informat service
- After restart, you need to perform the following checks:
- System Authorization: Since system authorization is bound to the machine, you need to access the management backend to update the corresponding authorization
- Resource Configuration: You need to adjust the following configurations in
Management Backend>System Information>Parameter Settings- Login and Resources: Configure the homepage URL as the current service deployment address; for login address, mobile login URL, resource address, and API address,if configured, they need to be adjusted to the current service deployment address- File Preview Service: Configure the OnlyOffice file preview address as the current service deployment address :::
Application Table Data Migration
For concepts related to data tables, please refer to Application Table Data Structure. The following is the migration method using the command line. If using a database client for migration, please ignore the following content.
Notes
Database table lookup Physical table names are automatically generated based on the
z_{application-ID}_{table-ID}rule, where application ID and table ID are 12-digit unique IDs generated by the systemDatabase system Seq field lookup Sequence names are automatically generated based on the
z_{application-ID}_{table-ID}_seqrule, where application ID and table ID are 12-digit unique IDs generated by the systemData table serial number field sequence lookup Serial number field sequence names are automatically generated based on the
z_{application-ID}_{table-ID}_{field-ID}_seqrule, where application ID, table ID, and field ID are 12-digit unique IDs generated by the system
Data Backup
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_biz_prd_0 -t z_{application-ID}_{table-ID} -a --inserts > z_{application-ID}_{table-ID}.sqlData Import
/usr/local/pgsql/bin/psql -U postgres -d db_informat2_biz_prd_0 -f z_{application-ID}_{table-ID}.sqlReset Sequence Values
Database system Seq field
sql-- Update data table sequence value to source value UPDATE z_{application-ID}_{table-ID}_seq SET "last_value"={source-value};Data table serial number field sequence (if the data table has one)
sql-- Update data table serial number field sequence value to source value UPDATE z_{application-ID}_{table-ID}_{field-ID}_seq SET "last_value"={source-value};
Migrate Attachments
The following path files need to be migrated:
- /data/minio_home
- {installation-directory}/file_storage
Example
scp /data/minio_home informat@192.168.1.2:/data/minio_home
scp /informat-next/file_storage informat@192.168.1.2:/informat-next/file_storageINFO
If the target file already exists, you need to first transfer it to a temporary path and then overwrite the target path file

