Czymaj.
Ja takiego używam - mogłem przeoczyć jakieś moje custom tabele czy kolumny, ale raczej posprzątałem.
(tylko backup bazy zrób)
#1104 - baza danych lms-a 1.10.4 #lmsgit - baza z LMS-git
use 1104;
delete from customers where deleted = 1; delete from nodes where ownerid not in (select id from customers); delete from cashimport where customerid not in (select id from customers); delete from customercontacts where customerid not in (select id from customers);
insert into lmsgit.customers (id, lastname, name, status, email, address, zip, city, ten, ssn, regon, rbe, icn, info, notes, creationdate, moddate, creatorid, modid, deleted, message, pin) (select id, lastname, name, status, email, address, zip, city, ten, ssn, regon, rbe, icn, info, notes, creationdate, moddate, creatorid, modid, deleted, message, pin from customers);
insert into lmsgit.customercontacts (id, customerid, name, phone) (select id, customerid, name, phone from customercontacts);
insert into lmsgit.hosts (select * from hosts);
insert into lmsgit.daemoninstances (select * from daemoninstances);
insert into lmsgit.daemonconfig (select * from daemonconfig);
insert into lmsgit.networks (id, name, address, mask, gateway, interface) (select id, name, address, mask, gateway, interface);
insert into lmsgit.nodes (id, name, ipaddr, ipaddr_pub, ownerid, creationdate, moddate, access, warning, location, netid) (select nodes.id, nodes.name, ipaddr, ipaddr_pub, ownerid, creationdate, moddate, access, warning, location, networks.id from nodes left join networks on (ipaddr & inet_aton(networks.mask) = networks.address) and networks.id is not null);
insert into lmsgit.macs (mac, nodeid) (select mac, id from nodes);
insert into lmsgit.tariffs (id, name, value, taxid, upceil, downceil) (select id, name, value, taxid, upceil, downceil from tariffs);
insert into lmsgit.assignments (id, tariffid, customerid, period, at, datefrom, dateto, invoice, paytype) (select id, tariffid, customerid, period, at, datefrom, dateto, invoice, 1 from assignments);
insert into lmsgit.nodeassignments (assignmentid, nodeid) (select a.id, n.nodeid from assignments a join nodeassignments n ON a.id = n.assignmentid);
insert into lmsgit.cashimport (id, date, value, customer, description, customerid, hash, closed) (select * from cashimport);
insert into lmsgit.cash (id, time, type, userid, value, taxid, customerid, comment, docid, itemid) (select id, time, type, userid, value, taxid, customerid, comment, docid, itemid from cash);
insert into lmsgit.documents (id, type, number, numberplanid, extnumber, cdate, customerid, userid, name, address, zip, city, ten, ssn, paytime, paytype, closed, reference, reason) (select id, type, number, numberplanid, extnumber, cdate, customerid, userid, name, address, zip, city, ten, ssn, paytime, (CASE paytype WHEN 'TRANSFER' THEN 2 WHEN 'PRZELEW' THEN 2 WHEN 'CASH' then 1 WHEN 'Gotówka' THEN 1 END), closed, reference, reason from documents);
insert into lmsgit.documentcontents (select * from documentcontents);
insert into lmsgit.domains (id, ownerid, name, description) (select id, ownerid, name, description from domains);
insert into lmsgit.numberplans (select * from numberplans);
insert into lmsgit.passwd (id, ownerid, login, `password`, lastlogin, uid, home, `type`, expdate, domainid, quota_sh, quota_mail, quota_www, quota_ftp, quota_sql, realname, createtime) (select id, ownerid, login, `password`, lastlogin, uid, home, `type`, expdate, domainid, quota_sh, quota_mail, quota_www, quota_ftp, quota_sql, realname, createtime from passwd);
insert into lmsgit.taxes (select * from taxes);
insert into lmsgit.invoicecontents (docid, itemid, value, taxid, prodid, content, count, description, tariffid) (select docid, itemid, value, taxid, prodid, content, count, description, tariffid from invoicecontents);
#### #Dodaj oddział w lms ####
update lmsgit.customers set divisionid=1,countryid=2;
update lmsgit.documents set sdate = cdate, div_name = "P.P.H.U XYZ", div_shortname = "P.P.H.U. XYZ", div_address = "Adres oddzialu", div_city = "Miasto", \ div_zip = "kod", div_ten = "nip", div_account = "konto", divisionid=1, countryid=2, div_countryid=2, paytype=2, \ div_inv_header = "Naglowek", \ div_inv_author = "Wystawił", div_inv_cplace = "Miasto";
### przypisać plany numeracyjne
i chyba voila.
Jakby ktoś miał coś do dodania, to smiało.
W dniu 4 kwietnia 2015 09:59 użytkownik Arturz arturz@kl.net.pl napisał:
Witam,
W jakiej kwocie możecie napisać skrypt przenoszący dane z LMS 1.10.4 do aktualnego Do przeniesienia klienci komputery sieci
Mam stary LMS 1.10.4 na starej maszynie, a nowy będzie na innej. Do tej pory służył do obsługi Etherwerxa. I to musi pozostać!!!
Wypełnione pola informacje dodatkowe i lokalizacje, adres, telefon IP, MAC .... etc
Urządzenia sieciowe można wykasować i tak będą od nowa wprowadzane(teraz to są bzdury) Help desk wykasować. Brak faktur, dokumentów - prawie dziewiczy ;-P
lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms