Backup and migration Tvip TMS to another server
Creating a backup of PostgreSQL database
You can backup the database using the pg_dump
utility:
pg_dump --no-owner -U tvip-tms tvip-tms > /backup/tvip-tms.sql
Hint
With the --exclude-table-data
parameter, you can exclude tables that do not require backup to reduce the backup file size and speed up the recovery process:
pg_dump --no-owner --exclude-table-data=device_stat_channel -U tvip-tms tvip-tms > /backup/tvip-tms.sql
Backup additional databases if necessary:
pg_dump --no-owner -U tvip-tms tvip-tms-audit > /backup/tvip-tms-audit.sql
pg_dump --no-owner -U tvip-tms tvip-tms-vod > /backup/tvip-tms-vod.sql
Copy the database backup using the scp
utility:
scp /backup/tvip-tms.sql username@host:/backup/
Recovery from a PostgreSQL Database Backup
Ensure that the system meets the minimum TVIP TMS requirements.
Before installing TVIP TMS, you must install the database and restore the data from a backup.
Set and check that the locale selected is: [*] en_US.UTF-8 UTF-8. If necessary, add the locales you need.
sudo apt -y install postgresql
Create a database with the name tvip-tms and the user tvip-tms:
su -c "createuser tvip-tms && createdb -O tvip-tms tvip-tms" postgres
If necessary, create additional databases:
su -c "createdb -O tvip-tms tvip-tms-audit" postgres
su -c "createdb -O tvip-tms tvip-tms-vod" postgres
Change the postgres access settings:
sed -i /etc/postgresql/*/main/pg_hba.conf -e "s|local all all peer|local all all trust|"
sed -i /etc/postgresql/*/main/pg_hba.conf -e "s|host all all 127.0.0.1/32 md5|host all all 127.0.0.1/32 trust|"
sed -i /etc/postgresql/*/main/pg_hba.conf -e "s|host all all 127.0.0.1/32 scram-sha-256|host all all 127.0.0.1/32 trust|"
systemctl reload postgresql
Recovery the database backup:
psql -U tvip-tms tvip-tms < /backup/tvip-tms.sql
Reset the value for auth key:
psql -U tvip-tms tvip-tms
update device set authkey = null;
\q
Set TVIP TMS.
Attention
To migrate devices without requiring a login and password, enable the Allow Quick Binding option in the provider settings.
If necessary, change the ip address of your TVIP TMS server or redirect DNS to a new TVIP TMS server.