Fork me on GitHub

Rapport de message :*
 

Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL

Titre du sujet : Re: Migration de base punBB vers Xoops 2.3.3 + cbb4 RC et problème de script SQL
par Jah sur 28/03/2009 23:03:20

Ç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_idpost_text)
SELECT pun_posts.idpun_posts.message
FROM pun_topics left join pun_posts on pun_topics
.id pun_posts.topic_id
order by pun_posts
.idpun_posts.topic_id;


qui me cause cette erreur

Erreur

requête SQL
Documentation

INSERT INTO xoops_bb_posts_text
post_idpost_text )
SELECT pun_posts.idpun_posts.message
FROM pun_topics
LEFT JOIN pun_posts ON pun_topics
.id pun_posts.topic_id
ORDER BY pun_posts
.idpun_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 (uidunameemailpassnameurluser_icquser_msnmuser_aimuser_yimuser_fromuser_sigattachsigtimezone_offsetpostsuser_regdatelast_loginactkeyranklevel)
select idusernameemailpasswordrealnameurlicqmsnaimyahoolocationsignatureshow_sigtimezonenum_postsregisteredlast_visitactivate_key0,1 from pun_users where id <>1;

# Add users in registred users group

insert into xoops_groups_users_link (groupiduid)
select 2uid from xoops_users where uid <>1;

####  Forum CBB 1.15 ####

# Migration categories

insert into xoops_bb_categories (cat_idcat_titlecat_order)
select idcat_namedisp_position from pun_categories;


# Migration forums

insert into xoops_bb_forums (forum_idforum_nameforum_descforum_moderatorforum_topicsforum_postsforum_last_post_idforum_ordercat_id)
select idforum_nameforum_descmoderatorsnum_topicsnum_postslast_post_iddisp_positioncat_id from pun_forums;


# Migration topics
insert into xoops_bb_topics (topic_idtopic_postertopic_titletopic_timetopic_last_post_idposter_nametopic_viewstopic_repliestopic_statustopic_stickyforum_id)
select idpostersubjectpostedlast_post_idlast_posternum_viewsnum_repliesclosedstickyforum_id from pun_topics;

# Migration posts

insert into xoops_bb_posts
(post_idposter_nameuidposter_ippost_timetopic_idforum_idsubject)
SELECT pun_posts.idpun_posts.posterposter_idINET_ATON(poster_ip), pun_posts.postedtopic_idforum_idsubject
FROM pun_topics left join pun_posts on pun_topics
.id pun_posts.topic_id
order by pun_posts
.idpun_posts.topic_id;

# Migration text posts
insert into xoops_bb_posts_text (post_idpost_text)
SELECT pun_posts.idpun_posts.message
FROM pun_topics left join pun_posts on pun_topics
.id pun_posts.topic_id
order by pun_posts
.idpun_posts.topic_id;

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

18 Personne(s) en ligne (15 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 18 | Plus ...