Howtos:Migrate your OCS database to UTF8

From OCS Inventory NG
Jump to: navigation, search

Migrate old OCS database from LATIN to UTF8

Execute this query on your mysql server :

ALTER TABLE accesslog CONVERT TO CHARACTER SET utf8;
ALTER TABLE accountinfo CONVERT TO CHARACTER SET utf8;
ALTER TABLE accountinfo_config CONVERT TO CHARACTER SET utf8;
ALTER TABLE bios CONVERT TO CHARACTER SET utf8;
ALTER TABLE blacklist_macaddresses CONVERT TO CHARACTER SET utf8;
ALTER TABLE blacklist_serials CONVERT TO CHARACTER SET utf8;

ALTER TABLE blacklist_subnet MODIFY MASK varchar(150);
ALTER TABLE blacklist_subnet MODIFY SUBNET varchar(150);
ALTER TABLE blacklist_subnet CONVERT TO CHARACTER SET utf8;
ALTER TABLE config CONVERT TO CHARACTER SET utf8;
ALTER TABLE conntrack CONVERT TO CHARACTER SET utf8;
ALTER TABLE controllers CONVERT TO CHARACTER SET utf8;
ALTER TABLE deleted_equiv CONVERT TO CHARACTER SET utf8;
ALTER TABLE deploy CONVERT TO CHARACTER SET utf8;
ALTER TABLE devices CONVERT TO CHARACTER SET utf8;
ALTER TABLE devicetype CONVERT TO CHARACTER SET utf8;
ALTER TABLE dico_ignored CONVERT TO CHARACTER SET utf8;
ALTER TABLE dico_soft CONVERT TO CHARACTER SET utf8;
ALTER TABLE download_affect_rules CONVERT TO CHARACTER SET utf8;
ALTER TABLE download_available CONVERT TO CHARACTER SET utf8;
ALTER TABLE download_enable CONVERT TO CHARACTER SET utf8;
ALTER TABLE download_history CONVERT TO CHARACTER SET utf8;
ALTER TABLE download_servers CONVERT TO CHARACTER SET utf8;
ALTER TABLE downloadwk_conf_values CONVERT TO CHARACTER SET utf8;
ALTER TABLE downloadwk_fields CONVERT TO CHARACTER SET utf8;
ALTER TABLE downloadwk_history CONVERT TO CHARACTER SET utf8;
ALTER TABLE downloadwk_pack CONVERT TO CHARACTER SET utf8;
ALTER TABLE downloadwk_statut_request CONVERT TO CHARACTER SET utf8;
ALTER TABLE downloadwk_tab_values CONVERT TO CHARACTER SET utf8;
ALTER TABLE drives CONVERT TO CHARACTER SET utf8;
ALTER TABLE engine_mutex CONVERT TO CHARACTER SET utf8;
ALTER TABLE engine_persistent CONVERT TO CHARACTER SET utf8;

ALTER TABLE files MODIFY NAME varchar(110);
ALTER TABLE files MODIFY VERSION varchar(80);
ALTER TABLE files MODIFY OS varchar(110);
ALTER TABLE files CONVERT TO CHARACTER SET utf8;
ALTER TABLE groups CONVERT TO CHARACTER SET utf8;
ALTER TABLE groups_cache CONVERT TO CHARACTER SET utf8;
ALTER TABLE hardware CONVERT TO CHARACTER SET utf8;
ALTER TABLE hardware_osname_cache CONVERT TO CHARACTER SET utf8;
ALTER TABLE inputs CONVERT TO CHARACTER SET utf8;
ALTER TABLE itmgmt_comments CONVERT TO CHARACTER SET utf8;
ALTER TABLE javainfo CONVERT TO CHARACTER SET utf8;
ALTER TABLE journallog CONVERT TO CHARACTER SET utf8;
ALTER TABLE languages CONVERT TO CHARACTER SET utf8;
ALTER TABLE locks CONVERT TO CHARACTER SET utf8;
ALTER TABLE memories CONVERT TO CHARACTER SET utf8;
ALTER TABLE modems CONVERT TO CHARACTER SET utf8;
ALTER TABLE monitors CONVERT TO CHARACTER SET utf8;
ALTER TABLE netmap CONVERT TO CHARACTER SET utf8;
ALTER TABLE network_devices CONVERT TO CHARACTER SET utf8;
ALTER TABLE networks CONVERT TO CHARACTER SET utf8;
ALTER TABLE operators CONVERT TO CHARACTER SET utf8;
ALTER TABLE ports CONVERT TO CHARACTER SET utf8;
ALTER TABLE printers CONVERT TO CHARACTER SET utf8;
ALTER TABLE prolog_conntrack CONVERT TO CHARACTER SET utf8;
ALTER TABLE regconfig CONVERT TO CHARACTER SET utf8;
ALTER TABLE registry CONVERT TO CHARACTER SET utf8;
ALTER TABLE registry_name_cache CONVERT TO CHARACTER SET utf8;
ALTER TABLE registry_regvalue_cache CONVERT TO CHARACTER SET utf8;
ALTER TABLE slots CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_accountinfo CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_blades CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_cards CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_cartridges CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_computers CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_cpus CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_drives CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_fans CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_firewalls CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_inputs CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_laststate CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_loadbalancers CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_localprinters CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_memories CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_modems CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_networks CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_ports CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_powersupplies CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_printers CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_softwares CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_sounds CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_storages CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_switchinfos CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_switchs CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_trays CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_videos CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_communities CONVERT TO CHARACTER SET utf8;
ALTER TABLE softwares CONVERT TO CHARACTER SET utf8;
ALTER TABLE softwares_name_cache CONVERT TO CHARACTER SET utf8;
ALTER TABLE sounds CONVERT TO CHARACTER SET utf8;
ALTER TABLE storages CONVERT TO CHARACTER SET utf8;
ALTER TABLE subnet CONVERT TO CHARACTER SET utf8;
ALTER TABLE snmp_communities CONVERT TO CHARACTER SET utf8;

ALTER TABLE tags MODIFY Tag varchar(160);
ALTER TABLE tags MODIFY Login varchar(160);
ALTER TABLE tags CONVERT TO CHARACTER SET utf8;
ALTER TABLE temp_files CONVERT TO CHARACTER SET utf8;
ALTER TABLE videos CONVERT TO CHARACTER SET utf8;
ALTER TABLE virtualmachines CONVERT TO CHARACTER SET utf8;

ALTER DATABASE ocsweb CHARACTER SET utf8;