|
Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
|
Bonjour, je dois migrer une base PunBB version française 1.2.14.0 avec un interclassement en latin1_swedish_ci vers un Xoops 2.3.3 + cbb4 RC et un interclassement en utf8_unicode_ci Plus un passage de PHP 4.4.4-8, MySQL 5.0.32 vers PHP 5.2.6-2, MySQL 5.0.67 Cette base fait 20 Mo compressé en gz, comment la convertir en utf8_unicode_ci ? Pas trouvé de truc efficace. A noter que je suis sous Linux, mais bon si il faut que le fasse sous Windaube, je prendrais sur moi Y'a un topic içi avec des liens et des appli, mais j'arrive pas a le retrouver, bizarre. Et j'ai un ptit problème avec le script de migration a exécuter dans la fenêtre SQL de phpmyadmin, j'obtiens cette erreur
Erreur
requête SQL: Documentation
# Create users
INSERT INTO xoops_users( uid, uname, email, pass, name, url, user_icq, user_msnm, user_aim, user_yim, user_from, user_sig, attachsig, timezone_offset, posts, user_regdate, last_login, actkey, rank,
LEVEL )
SELECT id, username, email,
PASSWORD , realname, url, icq, msn, aim, yahoo, location, signature, show_sig, timezone, num_posts, registered, last_visit, activate_key, 0, 1
FROM form_users
WHERE id <>1# Add users in registred users group
INSERT INTO xoops_groups_users_link( groupid, uid )
SELECT 2 , uid
FROM xoops_users
WHERE uid <>1;
MySQL a répondu:Documentation
#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 'insert into xoops_groups_users_link ( groupid, uid )
select 2, uid from xoops_u' at line 5
Et là, je sèche totalement, j'y connais rien de chez que dalle, et j'arrive a rien malgrés mes recherches, so I need your help. Apparemment il bloque sur l'instruction select 2, uid from xoops_users where uid <>1; qu'il transforme en select 2, uid from xoops_u' bloqué par une apostrosphe qui n'existe pas dans le script, je pige pas. Voici le script que m'a fourni Christian
# punbb to Xoops 2.0.x CBB 1.15 Converter
# Copyright (C) 2005 Christian EDOM https://www.frxoops.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Purpose:
#
# The script was designed to transfer categories, forums, users, and posts
# from Punbb (http://www.punbb.org) to Xoops 2.0.X with Forum CBB 1.15
#
# Assumptions:
#
# - punbb, Xoops and CBB are installed on the same database
# - Xoops and CBB are installed and punbb has contents to transfer
# - Xoops tables are prefixed with "xoops_"
#
# If your table prefixes differ, please do a global search on these prefixes,
# replacing them with the correct prefixes for your installation.
#
# Directions:
#
# This script can be executed using phpMyAdmin or from the command line.
# Using phpMyAdmin, you can first click on the name of your database, then
# scroll down until you see "Run SQL query/queries on database". You can either
# cut and paste this script into this area, or locate this script from your
# home machine by pressing the "Browse:" button and then clicking on "Go."
#
# Notes:
#
# Due to differences in supported functionality between punbb and Forum CBB 1.15,
# some items cannot be converted:
#
# - Polls that accompany topics
# - Topics watch (e-mail alerts when responses are posted)
# - Security by categories and forums
#
# Create users
insert into xoops_users (uid, uname, email, pass, name, url, user_icq, user_msnm, user_aim, user_yim, user_from, user_sig, attachsig, timezone_offset, posts, user_regdate, last_login, actkey, rank, level)
select id, username, email, password, realname, url, icq, msn, aim, yahoo, location, signature, show_sig, timezone, num_posts, registered, last_visit, activate_key, 0,1 from form_users where id <>1
# Add users in registred users group
insert into xoops_groups_users_link (groupid, uid)
select 2, uid from xoops_users where uid <>1;
#### Forum CBB 1.15 ####
# Migration categories
insert into xoops_bb_categories (cat_id, cat_title, cat_order)
select id, cat_name, disp_position from form_categories
# Migration forums
insert into xoops_bb_forums (forum_id, forum_name, forum_desc, forum_moderator, forum_topics, forum_posts, forum_last_post_id, forum_order, cat_id)
select id, forum_name, forum_desc, moderators, num_topics, num_posts, last_post_id, disp_position, cat_id from form_forums;
# Migration topics
insert into xoops_bb_topics (topic_id, topic_poster, topic_title, topic_time, topic_last_post_id, poster_name, topic_views, topic_replies, topic_status, topic_sticky, forum_id)
select id, poster, subject, posted, last_post_id, last_poster, num_views, num_replies, closed, sticky, forum_id from form_topics;
# Migration posts
insert into xoops_bb_posts
(post_id, poster_name, uid, poster_ip, post_time, topic_id, forum_id, subject)
SELECT form_posts.id, form_posts.poster, poster_id, INET_ATON(poster_ip), form_posts.posted, topic_id, forum_id, subject
FROM form_topics left join form_posts on form_topics.id = form_posts.topic_id
order by form_posts.id, form_posts.topic_id;
# Migration text posts
insert into xoops_bb_posts_text (post_id, post_text)
SELECT form_posts.id, form_posts.message
FROM form_topics left join form_posts on form_topics.id = form_posts.topic_id
order by form_posts.id, form_posts.topic_id;
Posté le : 28/03/2009 16:54
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Xoops accro
Inscrit: 20/02/2008 20:27
De Belgium
|
Citation :Cette base fait 20 Mo compressé en gz, comment la convertir en utf8_unicode_ci ? Pas trouvé de truc efficace. Simplement avec phpMyAdmin, non? Citation :qu'il transforme en select 2, uid from xoops_u' bloqué par une apostrosphe qui n'existe pas dans le script C'est juste une extrait pour indiquer la place d'erreur. Essayez avec:
INSERT INTO xoops_groups_users_link( groupid, uid )
SELECT 2 as groupid, uid
FROM xoops_users
WHERE uid <>1;
Posté le : 28/03/2009 19:20
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
|
Merci Ghia Pour la conversion, j'ai un mélange de table en utf et latin, je ne peut convertir une sélrction de tables dans la même base, ca marche pas, je vais donc migrer les table en latin dans une base vierge et les faire passer en utf. Merci pour ta correction Ca m'en fait 2 a tester ce soir avec celle de l'admin de notre serveur qui m'en a sorti une aussi, je vous donne des news dans le weekend. Edit, les requètes SQL avec des tables totalisant plus de 100 Mo ça me fait bencher mes 2 opteron 250, ils tourne a 100 % tous les 2
Posté le : 28/03/2009 21:14
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
|
Ça progresse, je n'ai plus qu'une erreur avec juste la fin du script
# Migration text posts
insert into xoops_bb_posts_text (post_id, post_text)
SELECT pun_posts.id, pun_posts.message
FROM pun_topics left join pun_posts on pun_topics.id = pun_posts.topic_id
order by pun_posts.id, pun_posts.topic_id;
qui me cause cette erreur
Erreur
requête SQL: Documentation
INSERT INTO xoops_bb_posts_text( post_id, post_text )
SELECT pun_posts.id, pun_posts.message
FROM pun_topics
LEFT JOIN pun_posts ON pun_topics.id = pun_posts.topic_id
ORDER BY pun_posts.id, pun_posts.topic_id
MySQL a répondu:Documentation
#1062 - Duplicate entry '0' for key 1
La table concernée ayant au préalable vidé bien sur. Si quelqu'un a une idée pour résoudre ce soucis. Voila le script en entier
# punbb to Xoops 2.0.x CBB 1.15 Converter
# Copyright (C) 2005 Christian EDOM https://www.frxoops.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Purpose:
#
# The script was designed to transfer categories, forums, users, and posts
# from Punbb (http://www.punbb.org) to Xoops 2.0.X with Forum CBB 1.15
#
# Assumptions:
#
# - punbb, Xoops and CBB are installed on the same database
# - Xoops and CBB are installed and punbb has contents to transfer
# - Xoops tables are prefixed with "xoops_"
#
# If your table prefixes differ, please do a global search on these prefixes,
# replacing them with the correct prefixes for your installation.
#
# Directions:
#
# This script can be executed using phpMyAdmin or from the command line.
# Using phpMyAdmin, you can first click on the name of your database, then
# scroll down until you see "Run SQL query/queries on database". You can either
# cut and paste this script into this area, or locate this script from your
# home machine by pressing the "Browse:" button and then clicking on "Go."
#
# Notes:
#
# Due to differences in supported functionality between punbb and Forum CBB 1.15,
# some items cannot be converted:
#
# - Polls that accompany topics
# - Topics watch (e-mail alerts when responses are posted)
# - Security by categories and forums
#
# Create users
insert into xoops_users (uid, uname, email, pass, name, url, user_icq, user_msnm, user_aim, user_yim, user_from, user_sig, attachsig, timezone_offset, posts, user_regdate, last_login, actkey, rank, level)
select id, username, email, password, realname, url, icq, msn, aim, yahoo, location, signature, show_sig, timezone, num_posts, registered, last_visit, activate_key, 0,1 from pun_users where id <>1;
# Add users in registred users group
insert into xoops_groups_users_link (groupid, uid)
select 2, uid from xoops_users where uid <>1;
#### Forum CBB 1.15 ####
# Migration categories
insert into xoops_bb_categories (cat_id, cat_title, cat_order)
select id, cat_name, disp_position from pun_categories;
# Migration forums
insert into xoops_bb_forums (forum_id, forum_name, forum_desc, forum_moderator, forum_topics, forum_posts, forum_last_post_id, forum_order, cat_id)
select id, forum_name, forum_desc, moderators, num_topics, num_posts, last_post_id, disp_position, cat_id from pun_forums;
# Migration topics
insert into xoops_bb_topics (topic_id, topic_poster, topic_title, topic_time, topic_last_post_id, poster_name, topic_views, topic_replies, topic_status, topic_sticky, forum_id)
select id, poster, subject, posted, last_post_id, last_poster, num_views, num_replies, closed, sticky, forum_id from pun_topics;
# Migration posts
insert into xoops_bb_posts
(post_id, poster_name, uid, poster_ip, post_time, topic_id, forum_id, subject)
SELECT pun_posts.id, pun_posts.poster, poster_id, INET_ATON(poster_ip), pun_posts.posted, topic_id, forum_id, subject
FROM pun_topics left join pun_posts on pun_topics.id = pun_posts.topic_id
order by pun_posts.id, pun_posts.topic_id;
# Migration text posts
insert into xoops_bb_posts_text (post_id, post_text)
SELECT pun_posts.id, pun_posts.message
FROM pun_topics left join pun_posts on pun_topics.id = pun_posts.topic_id
order by pun_posts.id, pun_posts.topic_id;
Posté le : 28/03/2009 23:03
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Xoops accro
Inscrit: 20/02/2008 20:27
De Belgium
|
Je ne sais pas pourquoi il faut le join, ca me semble de sert a rien. Essayez avec:
insert into xoops_bb_posts_text (post_id, post_text)
SELECT pun_posts.id, pun_posts.message
FROM pun_posts
order by pun_posts.id, pun_posts.topic_id;
Posté le : 28/03/2009 23:47
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
|
Merci Ghia, cela fonctionne, j'ai bien toutes les catégories et tous les forums ainsi que les posts. Mais, voui, y'a un gros mais quant je vais sur le forum, je n'ai que la première catégorie d'affichée, et pas de forum. Je suis obligé d'utiliser le menu contextuel pour voir tous les posts. Je fais quelques vérifications et je donne des news.
Posté le : 29/03/2009 00:33
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
|
Voila ou j'en suis. L'import ne fonctionne pas sous cbb4, mais fonctionne sous cbb 3.08 après quelques corrections, merci Ghia et Laurent de Techage. Par contre, gros soucis avec l'import des mots de passe, les utilisateurs ne peuvent plus se loguer, et j'ai vérifié avec un de mes comptes. Pourtant les MDP sont bien présent dans la table user, et j'ai bien sur mis a jour le module system. Voici le script dans sa forme actuel. Citation :# punbb to Xoops 2.3.x CBB 3.08 Converter # Copyright (C) 2005 Christian EDOM https://www.frxoops.org # corrigé et mis a jour par : # Laurent aka W_SHaRK http://www.techage.fr # Ghia https://www.frxoops.org # Testé sous Xoops 2.3.3, cbb 3.08 a partir de PunBB 1.2.14.0 by Jah http://www.techage.fr # with PHP 4.4.4-8, MySQL 5.0.32 for PunBB and PHP 5.2.6-2, MySQL 5.0.67 for Xoops. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Purpose: # # The script was designed to transfer categories, forums, users, and posts # from Punbb (http://www.punbb.org) to Xoops 2.3.x with Forum CBB 3.08 # # Assumptions: # # - punbb, Xoops and CBB are installed on the same database # - Xoops and CBB are installed and punbb has contents to transfer # - Xoops tables are prefixed with "xoops_" # # If your table prefixes differ, please do a global search on these prefixes, # replacing them with the correct prefixes for your installation. # # Be sure the tables, xoops_bb_categories, xoops_bb_forums, xoops_bb_topics, xoops_bb_posts, xoops_bb_posts_text are empty. # # The PunBB tables are necessary is pun_categories, pun_forums, pun_posts, pun_topics, pun_users
# Directions: # # This script can be executed using phpMyAdmin or from the command line. # Using phpMyAdmin, you can first click on the name of your database, then # scroll down until you see "Run SQL query/queries on database". You can either # cut and paste this script into this area, or locate this script from your # home machine by pressing the "Browse:" button and then clicking on "Go." # # Notes: # # Due to differences in supported functionality between punbb and Forum CBB 1.15, # some items cannot be converted: # # - Polls that accompany topics # - Topics watch (e-mail alerts when responses are posted) # - Security by categories and forums #
# Create users
insert into xoops_users (uid, uname, email, pass, name, url, user_icq, user_msnm, user_aim, user_yim, user_from, user_sig, attachsig, timezone_offset, posts, user_regdate, last_login, actkey, rank, level) select id, username, email, password, realname, url, icq, msn, aim, yahoo, location, signature, show_sig, timezone, num_posts, registered, last_visit, activate_key, 0,1 from pun_users where id <>1;
# Add users in registred users group
insert into xoops_groups_users_link (groupid, uid) select 2, uid from xoops_users where uid <>1;
#### Forum CBB 3.08 ####
# Migration categories
insert into xoops_bb_categories (cat_id, cat_title, cat_order) select id, cat_name, disp_position from pun_categories;
# Migration forums
insert into xoops_bb_forums (forum_id, forum_name, forum_desc, forum_moderator, forum_topics, forum_posts, forum_last_post_id, forum_order, cat_id) select id, forum_name, forum_desc, moderators, num_topics, num_posts, last_post_id, disp_position, cat_id from pun_forums;
# Migration topics insert into xoops_bb_topics (topic_id, topic_poster, topic_title, topic_time, topic_last_post_id, poster_name, topic_views, topic_replies, topic_status, topic_sticky, forum_id) select id, poster, subject, posted, last_post_id, last_poster, num_views, num_replies, closed, sticky, forum_id from pun_topics;
# Migration posts
insert into xoops_bb_posts (post_id, poster_name, uid, poster_ip, post_time, topic_id, forum_id, subject) SELECT pun_posts.id, pun_posts.poster, poster_id, INET_ATON(poster_ip), pun_posts.posted, topic_id, forum_id, subject FROM pun_topics left join pun_posts on pun_topics.id = pun_posts.topic_id order by pun_posts.id, pun_posts.topic_id;
# Migration text posts insert into xoops_bb_posts_text (post_id, post_text) SELECT pun_posts.id, pun_posts.message FROM pun_posts order by pun_posts.id, pun_posts.topic_id;
Posté le : 29/03/2009 22:58
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Xoops accro
Inscrit: 20/02/2008 20:27
De Belgium
|
C'etait quoi le probleme avec: Citation :MySQL a répondu:Documentation #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 'insert into xoops_groups_users_link ( groupid, uid ) select 2, uid from xoops_u' at line 5 Pour le mot de passe, peut-etre punBB utilise une autre systeme de codage que le MD5 de XOOPS?
Posté le : 29/03/2009 23:20
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
|
Des ; qui manquais Pour les mots de passe, comment je peux savoir s'ils ont été encodé en MD5 ? en fouillant dans le code de PunBB ? Voici quelques mots de passe présent dans la BDD de PunBB Citation : 01fd310da569546d0729be04a0ca9efae6582a02 0201509a6b793877d24897386055a710162c1012 022472784039e4723d857209982cc457e643d648 0229187f3cbb0c5d7ccfa092fc4bfa8a3b717934 0238b31072c04b3de543689299aa072fc3e4609d
J'ai un autre soucis aussi, je n'est plus accès a l'édition de des membres dans l'admin, ni la création de membre, et quant j'édite un membre en passant par son profil, j'obtiens une page blanche, mais les modif sont prisent en compte. Tous ces problèmes peuvent ils provenir du passage de PHP 4.4.4-8, MySQL 5.0.32 pour PunBB et PHP 5.2.6-2, MySQL 5.0.67 pour Xoops a ton avis. Edit, a propos des mots de passe, voici ce que j'ai trouvé dans les fichier de PunBB
if (!empty($db_password_hash))
{
$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
$old_password_hash = pun_hash($old_password); // This could result in either an SHA-1 or an MD5 hash
if (($sha1_in_db && $sha1_available && $db_password_hash == $old_password_hash) ||
(!$sha1_in_db && $db_password_hash == md5($old_password)) ||
$pun_user['g_id'] < PUN_GUEST)
$authorized = true;
Posté le : 29/03/2009 23:45
|
|
|
Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL |
|
Xoops accro
Inscrit: 20/02/2008 20:27
De Belgium
|
Oui, les ; sont facile a ratee. Il me semble que vous avez la malchance d'avoir le sha1. Si vous entrez une utilisateur dans les deux systemes, ca va donneer une mot de passe differente. Alors il n'y a rien a faire, que de generee des nouveau mots pour chacun. Peut-etre il faut une insertion pour chaque utilisateur dans le tableaux profile ou quelque chose aussi. Creez une nouvelle utilisateur et regardez quoi est ajoutee dans le bdd.
Posté le : 30/03/2009 11:10
|
|
Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.
|