News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Passaggio da IPB 2.1 a SimpleMachines

Started by aga21, April 17, 2013, 09:25:36 AM

Previous topic - Next topic

aga21

Ciao a tutti, ho scaricato dal repository il file zip relativo a IPB 2.1 contenente convert.php e il file sql.

Lanciandoli ho subito un errore:

Converting members...Wrong value type sent to the database. Date expected. (birthdate)

Devo modificare qualcosa nei file?

emanuele

Ciao aga21 e benvenuto sul forum! :)

mmm...dato quell'errore, direi che i dati li legge dal db di IPB, ma o i dati non sono quelli che il converter si aspetta, oppure sbaglia ad "assemblarli".
Hai la possibilità di accedere al db via ad esempio phpmyadmin?
Se sì, sarebbe interessante deve cosa restituisce una query tipo questa:
SELECT
IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, 1, m.bday_year), IF(m.bday_month = 0, 1, m.bday_month), IF(m.bday_day = 0, 1, m.bday_day))) AS birthdate,
FROM {PREFISSO_IPB}members AS m
WHERE m.id != 0

In teoria dovrebbe ritornare una serie di valori che assomigliano a date (tipo 0004-1-1), prova a far scorrere la prime due o tre pagine e vedi se c'è qualcosa che non ha quell'aspetto. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Quote from: emanuele on April 17, 2013, 10:32:24 AM
Ciao aga21 e benvenuto sul forum! :)

Grazie, gentilissimo.

QuoteSe sì, sarebbe interessante deve cosa restituisce una query tipo questa:
SELECT
IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, 1, m.bday_year), IF(m.bday_month = 0, 1, m.bday_month), IF(m.bday_day = 0, 1, m.bday_day))) AS birthdate,
FROM {PREFISSO_IPB}members AS m
WHERE m.id != 0


restituisce

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM {PREFISSO_IPB}members AS m WHERE m.id != 0 LIMIT 0, 30' at line 3

iacomac

Cambia {PREFISSO_IPB} dopo il FROM col prefisso della tabella. ipb_ o quella che hai scelto al momento dell'installazione. O, comunque, quella che vedi sul nome della tabella, semplicemente.
My english teacher has committed suicide in despair, forgive my english...

emanuele

Yups...sorry, credevo di averlo scritto, ma era in un'altra discussione...

ETA e comunque l'errore è (anche) un altro:
SELECT
IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, 1, m.bday_year), IF(m.bday_month = 0, 1, m.bday_month), IF(m.bday_day = 0, 1, m.bday_day))) AS birthdate
FROM {PREFISSO_IPB}members AS m
WHERE m.id != 0


Così dovrebbe funzionare...(avevo lasciato la virgola dopo "birthdate").


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Scusate ma non sono molto pratico di MYSQL:

SELECT IF( m.bday_year =0
AND m.bday_month !=0
AND m.bday_day !=0, CONCAT(  '0004-', m.bday_month,  '-', m.bday_day ) , CONCAT_WS(  '-', IF( m.bday_year <=4, 1, m.bday_year ) , IF( m.bday_month =0, 1, m.bday_month ) , IF( m.bday_day =0, 1, m.bday_day ) ) ) AS birthdate
FROM ibf_members AS m
WHERE m.id !=0
LIMIT 0 , 30


restituisce come prima pagina

birthdate
1972-11-18
1917-7-11
1961-3-21
1972-4-27
1-1-1
1982-11-30
1978-7-5
1-1-1
1-1-1
1976-3-23
1972-1-8
1-1-1
1-1-1
1-1-1
1-1-1
1963-8-7
1976-9-13
1984-12-27
1972-8-28
1966-6-18
1983-4-30
1978-3-3


immagino che il problema siano gli 1-1-1

emanuele

Nope...gli 1-1-1 sono corretti, *assomigliano* ad una data (e sono usati per chi non ne ha inserita una).
Prova a guardare anche in seconda o terza pagina.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

ho guardato 30 pagine  :P

ci sono delle date NULL NULL NULL


emanuele

Eureka!
I null sono il problema.
heh...ed ora come non considerarli?

Prova così, trova la riga:
IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, 1, m.bday_year), IF(m.bday_month = 0, 1, m.bday_month), IF(m.bday_day = 0, 1, m.bday_day))) AS birthdate,
e sostituiscila con:
IF (m.bday_year IS NULL, '1-1-1', IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, 1, m.bday_year), IF(m.bday_month = 0, 1, m.bday_month), IF(m.bday_day = 0, 1, m.bday_day)))) AS birthdate,
Non ci metto la mano sul fuoco, ma dovrebbe funzionare...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Stesso errore:

Converting...
Converting members...Wrong value type sent to the database. Date expected. (birthdate)


ma non si potrebbe evitare l'importazione delle date di nascita se è questo che blocca lo script? Non è indispensabile per me.

emanuele

Sì, basta invece che sostituirla, rimuovere quella riga. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Ok, in invision21_to_smf.sql riga 101 passo da
   
   SUBSTRING(m.email, 1, 255) AS email_address,
IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, 1, m.bday_year), IF(m.bday_month = 0, 1, m.bday_month), IF(m.bday_day = 0, 1, m.bday_day))) AS birthdate,
SUBSTRING(me.website, 1, 255) AS website_title,


a

SUBSTRING(m.email, 1, 255) AS email_address,
SUBSTRING(me.website, 1, 255) AS website_title,


si presenta un nuovo messaggio di errore


Converting...
Converting members...Wrong value type sent to the database. Integer expected. (hide_email)


emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Quote from: emanuele on April 18, 2013, 07:40:11 AM
Io tendo ad odiare IPB...
Da qui: http://www.simplemachines.org/community/index.php?topic=238557.msg3400325#msg3400325
Cambia:
m.hide_email AS hide_email,
in
1 AS hide_email,

Intanto ti ringrazio nuovamente per la cortesia e la disponibilità, se poi posso contribuire donando qualcosa al progetto sarò contento di farlo.

Passi avanti comunque:

Converting...
Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics...Wrong value type sent to the database. Integer expected. (id_poll)


emanuele

http://www.simplemachines.org/community/index.php?topic=238557.msg3400851#msg3400851
---* {$to_prefix}topics
aggiungi dopo:

---{
$row['id_poll'] = (int) $row['id_poll'];
---}

Questo converter non è propriamente testato bene...

ETA: ti conviene guardare anche i messaggi successivi, dato che è probabile incorrerai negli stessi errori...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Dopo la modifica:
Wrong value type sent to the database. Integer expected. (modified_time)

seguendo quel topic ho aggiunto alla riga 304

$row['modified_time'] = (int) $row['modified_time'];

e l'errore non si è presentato, ora esce:



allora dopo ---* {$to_prefix}messages 200
---{


ho inserito:

if(empty($row['id_board']))
$row['id_board'] = 1;


come da post http://www.simplemachines.org/community/index.php?topic=404732.msg2878797#msg2878797

adesso ottengo:

Duplicate entry '17639' for key 'PRIMARY'

emanuele

A che passaggio ti esce questo errore?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Forse sono stato io a bloccarlo premendo il tasto CONTINUE, non avevo visto che si autoaggiorna, adesso sta elaborando

Converting...
Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Incomplete.

Not quite done yet!
This conversion has paused to avoid overloading your server, and hence not working properly.
Don't worry though, nothing's wrong - simply click the continue button below to start the converter from where it left off.


C'è un tasto CONTINUE con un conto alla rovescia che entro cinque secondi si attiva e nella barra del browser questo contatore si incrementa

/smf/convert.php?step=1&substep=7&start=3500
/smf/convert.php?step=1&substep=9&start=49200
e così via

emanuele

Sì, meglio lasciargli fare tutto a lui. :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

aga21

Quote from: emanuele on April 18, 2013, 12:01:07 PM
Sì, meglio lasciargli fare tutto a lui. :P

è arrivato a 508600! posso sapere il numero a cosa si riferisce per calcolare in maniera approssimata quando finirà?

Advertisement: