qrde, udało się. pg przyjął dump bez problemu, krotki też bez błędów :) finalnie mogę się zalogować i nie pokazuje żadnych błędów (jak narazie)
dla potomnych.
marcin@lmsSIIS2015:~$ cat mysql2pgsql.yml
# a socket connection will be selected if a 'socket' is specified # also 'localhost' is a special 'hostname' for MySQL that overrides the 'port' option # and forces it to use a local socket connection # if tcp is chosen, you can use compression
mysql: hostname: localhost port: 3306 socket: /var/run/mysqld/mysqld.sock username: lms password: lms database: lms compress: false destination: # if file is given, output goes to file, else postgres file: lms_pg.sql postgres: hostname: localhost port: 5432 username: lms password: database: lms
# if tables is given, only the listed tables will be converted. leave empty to convert all tables. #only_tables: #- table1 #- table2 only_tables: - users - customers - numberplans - assignments - cash - location_states - location_districts - location_boroughs - location_cities - location_street_types - location_streets - pna - hosts - networks - invprojects - nodes - nodelocks - macs - nodegroups - nodegroupassignments - nodeassignments - tariffs - promotions - promotionschemas - promotionassignments - liabilities - payments - taxes - documents - documentcontents - receiptcontents - invoicecontents - debitnotecontents - numberplanassignments - customergroups - customerassignments - stats - nodesessions - netlinks - rtqueues - rttickets - rtmessages - rtnotes - rtrights - rtattachments - rtcategories - rtcategoryusers - rtticketcategories - passwd - domains - records - supermasters - aliases - aliasassignments - uiconfig - events - eventassignments - sessions - cashsources - sourcefiles - cashimport - daemoninstances - daemonconfig - docrights - cashrights - cashregs - cashreglog - ewx_pt_config - ewx_stm_nodes - ewx_stm_channels - ewx_channels - netnodes - netdevices - dbinfo - imessengers - customercontacts - excludedgroups - states - countries - zipcodes - divisions - voipaccounts - messages - messageitems - nastypes - managementurls - logtransactions - logmessages - logmessagekeys - logmessagedata - templates - up_rights - up_rights_assignments - up_customers - up_help - up_info_changes
# if exclude_tables is given, exclude the listed tables from the conversion. #exclude_tables: #- table3 #- table4
# if supress_data is true, only the schema definition will be exported/migrated, and not the data supress_data: false
# if supress_ddl is true, only the data will be exported/imported, and not the schema supress_ddl: true
# if force_truncate is true, forces a table truncate before table loading force_truncate: true
# if timezone is true, forces to append/convert to UTC tzinfo mysql data timezone: true
# if index_prefix is given, indexes will be created whith a name prefixed with index_prefix index_prefix:
skrypt do zrobienia krotek:
#v+ marcin@lmsSIIS2015:~$ cat sequence #!/bin/bash
LISTA_SEQ="users_id_seq customers_id_seq numberplans_id_seq assignments_id_seq cash_id_seq location_states_id_seq location_districts_id_seq location_boroughs_id_seq location_cities_id_seq location_street_types_id_seq location_streets_id_seq pna_id_seq hosts_id_seq networks_id_seq invprojects_id_seq nodes_id_seq nodelocks_id_seq macs_id_seq nodegroups_id_seq nodegroupassignments_id_seq nodeassignments_id_seq tariffs_id_seq promotions_id_seq promotionschemas_id_seq promotionassignments_id_seq liabilities_id_seq payments_id_seq taxes_id_seq documents_id_seq debitnotecontents_id_seq numberplanassignments_id_seq customergroups_id_seq customerassignments_id_seq nodesessions_id_seq netlinks_id_seq rtqueues_id_seq rttickets_id_seq rtmessages_id_seq rtnotes_id_seq rtrights_id_seq rtcategories_id_seq rtcategoryusers_id_seq rtticketcategories_id_seq passwd_id_seq domains_id_seq records_id_seq supermasters_id_seq aliases_id_seq aliasassignments_id_seq uiconfig_id_seq events_id_seq cashsources_id_seq sourcefiles_id_seq cashimport_id_seq daemoninstances_id_seq daemonconfig_id_seq docrights_id_seq cashrights_id_seq cashregs_id_seq cashreglog_id_seq ewx_pt_config_id_seq ewx_stm_nodes_id_seq ewx_stm_channels_id_seq ewx_channels_id_seq netnodes_id_seq netdevices_id_seq imessengers_id_seq customercontacts_id_seq excludedgroups_id_seq states_id_seq countries_id_seq zipcodes_id_seq divisions_id_seq voipaccounts_id_seq messages_id_seq messageitems_id_seq nastypes_id_seq managementurls_id_seq logtransactions_id_seq logmessages_id_seq templates_id_seq up_rights_id_seq up_rights_assignments_id_seq up_customers_id_seq up_help_id_seq up_info_changes_id_seq"
for SEQ in $LISTA_SEQ; do KROTKA="id" SEQ_TABELA=`echo "$SEQ" | sed 's/_id_seq//'` echo "SELECT setval('${SEQ}', coalesce((select max(${KROTKA}) from ${SEQ_TABELA}), 1), true);" done #v-
mysql2pg https://github.com/philipsoutham/py-mysql2pgsql
zadziałało na: LMS 1.11-git DB: 2014111400
W dniu 6 lutego 2015 16:21 użytkownik Skiba Marek skibamarek@gmail.com napisał:
W dniu 6 lutego 2015 16:12 użytkownik Marcin marcin@nicram.net napisał:
nie mogę tego namierzyć w archiwum listy, ale kiedyś o tym było pisane, nawet sam chyba pytałem :) coś mi sie kojarzy, że musi być odpowiednia kolejność zrzucania tabel i sekwencji - chodzi o zależności.
Ja o tym pisałem, poszukaj w archiwum w okolicach daty 18.05.2013
lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms