Migrate to Zabbix 6.0 with as small downtime as possible.
alter table history_uint rename to history_uint_old; CREATE TABLE history_uint (LIKE history_uint_old INCLUDING ALL);
alter table history_str rename to history_str_old; CREATE TABLE history_str (LIKE history_str_old INCLUDING ALL);
alter table history_log rename to history_log_old; CREATE TABLE history_log (LIKE history_log_old INCLUDING ALL);
alter table history_text rename to history_text_old; CREATE TABLE history_text (LIKE history_text_old INCLUDING ALL);
alter table history rename to history_old; CREATE TABLE history (LIKE history_old INCLUDING ALL);
alter table trends_uint rename to trends_uint_old; CREATE TABLE trends_uint (LIKE trends_uint_old INCLUDING ALL);
alter table trends rename to trends_old; CREATE TABLE trends (LIKE trends_old INCLUDING ALL);
cat history_pk_prepare.sql | PGUSER=zabbix PGPASSWORD=zabbix psql zabbix
insert into history_uint select * from history_uint_old;
insert into history_log select * from history_log_old;
insert into history_text select * from history_text_old;
insert into history_str select * from history_str_old;
insert into history select * from history_old;
No comments:
Post a Comment