İki forumu birleştirmek

phpBB 3.0.x çalıştırılması ve kurulumu ile ilgili yardımı buradan alabilirsiniz. Lütfen MODlar ile ilgili sorunlarınızı buraya yazmayın.
Forum kuralları
- Yeni bir başlık açarken lütfen konu başlığına "Acil yardım", "Acele yardım" tarzlarında içerisinde "yardım" kelimesi geçen cümleler yazmayınız. Bu tip başlıklara kesinlikle cevap verilmeyecektir. Lütfen konu başlığına içeriği en iyi özetleyen anlaşılabilir bir cümle yazınız.

- Ayrıca yeni başlıklarınızı kesinlikle ilgili forumlara açınız. Örneğin, phpBB3 kurulum ve çalıştırması hakkında bir sorununuz varsa "3.0.x Destek Forumu" forumuna başlık açınız; phpBB3 temasından kaynaklı bir sorunuz varsa "3.0.x Stil/Tema Geliştirme & Tartışma & Yardım" forumuna başlık açınız; phpBB3 mod/eklentileriyle ilgili sorununuz varsa "3.0.x MOD Destek" forumuna başlık açınız. Bu kurala uymayan kullanıcıların başlıkları silinebilir ve kullanıcı uyarı alabilir ya da süresiz uzaklaştırılabilir.

- Site kurallarımızı okumadan kesinlikle forumlarımıza herhangi bir katılım yapmayınız.
Kilitli
AkrepKral
Kayıtlı Kullanıcı
Mesajlar: 32
Kayıt: 07.01.2006, 23:58
İletişim:

İki forumu birleştirmek

Mesaj gönderen AkrepKral »

Arkadaşlar Phpbb3 tabanlı 2 veya daha fazla forumu (Veritabanı ile) tek bir forum halinde birleştirmek mümkün mü?
Muhammet Dilmaç
Kayıtlı Kullanıcı
Mesajlar: 41
Kayıt: 03.06.2013, 16:52

Re: İki forumu birleştirmek

Mesaj gönderen Muhammet Dilmaç »

Bunu otomatik olarak yapılabilir mi bilmiyorum bir tools var mı yok mu diye fakat el ile yapılabilir...
Kullanıcı avatarı
Özcan Akbulut
Kayıtlı Kullanıcı
Mesajlar: 2426
Kayıt: 14.06.2008, 16:52
Konum: Nürnberg
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen Özcan Akbulut »

akblt.space

Başlangiç Bilgileri phpBB 3.0.x :: 3.1.x
AkrepKral
Kayıtlı Kullanıcı
Mesajlar: 32
Kayıt: 07.01.2006, 23:58
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen AkrepKral »

Teşekkürler arkadaşlar bu işi otomatik yapan bir eklenti yok mu acaba?
Kullanıcı avatarı
ZeNaNLi
Eklenti Özelleştirme Ekibi Üyesi
Eklenti Özelleştirme Ekibi Üyesi
Mesajlar: 1284
Kayıt: 01.07.2010, 11:27
Konum: İstanbul
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen ZeNaNLi »

Bütün başlıkları seçip tek bir foruma taşıyabilirsiniz.
Resim
Kurallarımız gereği lütfen özel mesaj ile yardım istemeyiniz, cevap vermiyoruz.
AkrepKral
Kayıtlı Kullanıcı
Mesajlar: 32
Kayıt: 07.01.2006, 23:58
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen AkrepKral »

Nasıl yani? a ve b sitelerinin forumlarının db'leri birleştirilecek forum içi değil
AkrepKral
Kayıtlı Kullanıcı
Mesajlar: 32
Kayıt: 07.01.2006, 23:58
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen AkrepKral »

Arkadaşlar aşağıdaki metinleri anlaşılabilir şekilde tercüme edebilir misiniz. Çeviricilerden pek bir şey anlaşılmıyor. Birleştirme yapmak isteyen arkadaşlara da faydalı olsun.
EsmerÖzcan'ın verdiği linkte çözümü bulmuşlar ancak çok karmaşık duruyor.

Kod: Tümünü seç

First of all please refer to this topic: https://www.phpbb.com/community/viewtopic.php?f=65&t=1917165
and in particular to this post: https://www.phpbb.com/community/viewtopic.php?p=13251640#p13251640

Please note that the queries might not be up to date if the database schema has changed in later releases. Please check that the list of columns is complete and correct in the big merging queries.

A full and better written guide will appear in the future if I have time, for now here is the rough list of steps. Thanks to brudertorgen for the initial procedure (some parts of which I have copy-pasted from his post in the topic I linked).

Attached to this tutorial there are three php scripts. Thanks to Giacomo Drago for writing them. You must open them and fill in your database name, username and password.

There is also a tool for renaming the the attachment, thumbnail and avatar files (this is necessary due to the way phpBB stores them. It's for Windows only, sorry. VB.NET source code is attached.

------------ THERE WE GO! ------------

Preliminary:
access the old database from phpmyadmin and perform the following renames:
RENAME TABLE phpbb_attachments TO phpbb_attachments_2;
RENAME TABLE phpbb_bookmarks TO phpbb_bookmarks_2;
RENAME TABLE phpbb_config TO phpbb_config_2;
RENAME TABLE phpbb_drafts TO phpbb_drafts_2;
RENAME TABLE phpbb_forums TO phpbb_forums_2;
RENAME TABLE phpbb_poll_options TO phpbb_poll_options_2;
RENAME TABLE phpbb_poll_votes TO phpbb_poll_votes_2;
RENAME TABLE phpbb_posts TO phpbb_posts_2;
RENAME TABLE phpbb_privmsgs TO phpbb_privmsgs_2;
RENAME TABLE phpbb_privmsgs_to TO phpbb_privmsgs_to_2;
RENAME TABLE phpbb_smilies TO phpbb_smilies_2;
RENAME TABLE phpbb_topics TO phpbb_topics_2;
RENAME TABLE phpbb_users TO phpbb_users_2;

Dump all these tables, then rename them back to the original name.

RENAME TABLE phpbb_attachments_2 TO phpbb_attachments;
RENAME TABLE phpbb_bookmarks_2 TO phpbb_bookmarks;
RENAME TABLE phpbb_config_2 TO phpbb_config;
RENAME TABLE phpbb_drafts_2 TO phpbb_drafts;
RENAME TABLE phpbb_forums_2 TO phpbb_forums;
RENAME TABLE phpbb_poll_options_2 TO phpbb_poll_options;
RENAME TABLE phpbb_poll_votes_2 TO phpbb_poll_votes;
RENAME TABLE phpbb_posts_2 TO phpbb_posts;
RENAME TABLE phpbb_privmsgs_2 TO phpbb_privmsgs;
RENAME TABLE phpbb_privmsgs_to_2 TO phpbb_privmsgs_to;
RENAME TABLE phpbb_smilies_2 TO phpbb_smilies;
RENAME TABLE phpbb_topics_2 TO phpbb_topics;
RENAME TABLE phpbb_users_2 TO phpbb_users;

Import them to the new database.
Backup the new database NOW, since this is the step from which you will start over if something goes wrong.

Here all all the queries.

------------ READ AND NOTE DOWN THE FOLLOWING ------------


SELECT MAX( user_id ) FROM phpbb_users; --> max_user_id
SELECT MAX( msg_id ) FROM phpbb_privmsgs; --> max_pm_id
SELECT MAX( forum_id ) FROM phpbb_forums; --> max_forum_id
SELECT MAX( right_id ) FROM phpbb_forums; --> max_right_id
SELECT MAX( topic_id ) FROM phpbb_topics; --> max_topic_id
SELECT MAX( post_id ) FROM phpbb_posts; --> max_post_id
SELECT MAX( draft_id ) FROM phpbb_drafts; --> max_draft_id
SELECT MAX( attach_id ) FROM phpbb_attachments; -> max_attach_id

SELECT config_value FROM `phpbb_config_2` WHERE config_name LIKE 'avatar_salt'; --> Old avatar salt (for the renaming tool)
SELECT config_value FROM `phpbb_config` WHERE config_name LIKE 'avatar_salt'; --> New avatar salt (for the renaming tool)

SELECT group_id FROM `phpbb_groups` WHERE group_name ='REGISTERED'; --> reg_users_group_id


In all subsequent queries, whenever you see max_user_id, or max_draft_id or so, you must replace it with the value you have noted down for it. You can perform a find and replace if you wish.


------------ USERS ------------

alter table phpbb_users_2 add user_id_old mediumint(8);

ALTER TABLE phpbb_users_2 CHANGE `user_id` `user_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;
alter table phpbb_users_2 drop primary key;

update phpbb_users_2 set user_id = user_id + max_user_id;

update phpbb_posts_2 set poster_id = poster_id + max_user_id;

update phpbb_posts_2 set post_edit_user = post_edit_user + max_user_id;

update phpbb_topics_2 set topic_poster = topic_poster + max_user_id, topic_last_poster_id = topic_last_poster_id +max_user_id;

update phpbb_forums_2 set forum_last_poster_id = forum_last_poster_id + max_user_id;

update phpbb_privmsgs_2 set author_id = author_id + max_user_id;

update phpbb_privmsgs_to_2 set user_id = user_id + max_user_id, author_id = author_id + max_user_id;

UPDATE phpbb_users_2, phpbb_users
SET phpbb_users_2.user_id_old = phpbb_users_2.user_id, phpbb_users_2.user_id = phpbb_users.user_id WHERE phpbb_users_2.username_clean LIKE phpbb_users.username_clean;

update phpbb_posts_2, phpbb_users_2
set phpbb_posts_2.poster_id = phpbb_users_2.user_id
where phpbb_posts_2.poster_id = phpbb_users_2.user_id_old;

update phpbb_posts_2, phpbb_users_2
set phpbb_posts_2.post_edit_user = phpbb_users_2.user_id
where phpbb_posts_2.post_edit_user = phpbb_users_2.user_id_old;

update phpbb_forums_2, phpbb_users_2
set phpbb_forums_2.forum_last_poster_id = phpbb_users_2.user_id where phpbb_forums_2.forum_last_poster_id = phpbb_users_2.user_id_old;

update phpbb_topics_2, phpbb_users_2
set phpbb_topics_2.topic_poster = phpbb_users_2.user_id where phpbb_topics_2.topic_poster = phpbb_users_2.user_id_old;

update phpbb_topics_2, phpbb_users_2
set phpbb_topics_2.topic_last_poster_id = phpbb_users_2.user_id where phpbb_topics_2.topic_last_poster_id = phpbb_users_2.user_id_old;

update phpbb_privmsgs_2, phpbb_users_2
set phpbb_privmsgs_2.author_id = phpbb_users_2.user_id
where phpbb_privmsgs_2.author_id = phpbb_users_2.user_id_old;

update phpbb_privmsgs_to_2, phpbb_users_2
set phpbb_privmsgs_to_2.author_id = phpbb_users_2.user_id
where phpbb_privmsgs_to_2.author_id = phpbb_users_2.user_id_old;

update phpbb_privmsgs_to_2, phpbb_users_2
set phpbb_privmsgs_to_2.user_id = phpbb_users_2.user_id
where phpbb_privmsgs_to_2.user_id = phpbb_users_2.user_id_old;



INSERT INTO phpbb_users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd, user_form_salt, user_new, user_reminded, user_reminded_time) select user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd, user_form_salt, user_new, user_reminded, user_reminded_time from phpbb_users_2 where user_id_old is null;

------------ END OF USERS ------------

------------ PMS, PART 1 ------------

update phpbb_privmsgs_to_2 set folder_id = 0 where folder_id > 0;

ALTER TABLE phpbb_privmsgs_2 CHANGE `msg_id` `msg_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;
alter table phpbb_privmsgs_2 drop primary key;

update phpbb_privmsgs_2 set msg_id = msg_id + max_pm_id;

ALTER TABLE phpbb_privmsgs_to_2 CHANGE `msg_id` `msg_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;
update phpbb_privmsgs_to_2 set msg_id = msg_id + max_pm_id;

------------ PMS, END OF PART 1 ------------


Run script1.php. It may take some time, please wait until it's finished. The more private messages you have, the longer this script will take.
Be careful to run the script ONCE ONLY.


------------ PMS, PART 2 ------------

INSERT INTO phpbb_privmsgs (msg_id, root_level, author_id, icon_id, author_ip, message_time, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, message_subject, message_text, message_edit_reason, message_edit_user, message_attachment, bbcode_bitfield, bbcode_uid, message_edit_time, message_edit_count, to_address, bcc_address, message_reported) select msg_id, root_level, author_id, icon_id, author_ip, message_time, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, message_subject, message_text, message_edit_reason, message_edit_user, message_attachment, bbcode_bitfield, bbcode_uid, message_edit_time, message_edit_count, to_address, bcc_address, message_reported from phpbb_privmsgs_2;

INSERT INTO phpbb_privmsgs_to (msg_id, user_id, author_id, pm_deleted, pm_new, pm_unread, pm_replied, pm_marked, pm_forwarded, folder_id)
select msg_id, user_id, author_id, pm_deleted, pm_new, pm_unread, pm_replied, pm_marked, pm_forwarded, folder_id
from phpbb_privmsgs_to_2

------------ PMS, END OF PART 2 ------------


------------ FORUMS ------------

ALTER TABLE phpbb_forums_2 CHANGE `forum_id` `forum_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;

alter table phpbb_forums_2 drop primary key;

update phpbb_forums_2 set forum_id = forum_id + max_forum_id, right_id = right_id + max_right_id, left_id = left_id + max_right_id;

update phpbb_forums_2 set parent_id = parent_id + max_forum_id where parent_id <> 0;

update phpbb_topics_2 set forum_id = forum_id + max_forum_id;

update phpbb_posts_2 set forum_id = forum_id + max_forum_id;

------------ END OF FORUMS ------------


------------ TOPICS ------------

ALTER TABLE phpbb_topics_2 CHANGE `topic_id` `topic_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;

alter table phpbb_topics_2 drop primary key;

update phpbb_topics_2 set topic_id = topic_id + max_topic_id;

update phpbb_posts_2 set topic_id = topic_id + max_topic_id;

------------ END OF TOPICS ------------


------------ POSTS ------------

ALTER TABLE phpbb_posts_2 CHANGE `post_id` `post_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;
alter table phpbb_posts_2 drop primary key;

update phpbb_posts_2 set post_id = post_id + max_post_id;

update phpbb_forums_2 set forum_last_post_id = forum_last_post_id + max_post_id;

update phpbb_topics_2 set topic_first_post_id = topic_first_post_id +max_post_id, topic_last_post_id = topic_last_post_id + max_post_id;

------------ END OF POSTS ------------


------------ MERGE STUFF ------------

INSERT INTO phpbb_forums (forum_id, parent_id, left_id, right_id, forum_parents, forum_name, forum_desc, forum_desc_bitfield, forum_desc_options, forum_desc_uid, forum_link, forum_password, forum_style, forum_image, forum_rules, forum_rules_link, forum_rules_bitfield, forum_rules_options, forum_rules_uid, forum_topics_per_page, forum_type, forum_status, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_post_subject, forum_last_post_time, forum_last_poster_name, forum_last_poster_colour, forum_flags, forum_options, display_subforum_list, display_on_index, enable_indexing, enable_icons, enable_prune, prune_next, prune_days, prune_viewed, prune_freq)
select forum_id, parent_id, left_id, right_id, forum_parents, forum_name, forum_desc, forum_desc_bitfield, forum_desc_options, forum_desc_uid, forum_link, forum_password, forum_style, forum_image, forum_rules, forum_rules_link, forum_rules_bitfield, forum_rules_options, forum_rules_uid, forum_topics_per_page, forum_type, forum_status, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_post_subject, forum_last_post_time, forum_last_poster_name, forum_last_poster_colour, forum_flags, forum_options, display_subforum_list, display_on_index, enable_indexing, enable_icons, enable_prune, prune_next, prune_days, prune_viewed, prune_freq from phpbb_forums_2;

INSERT INTO phpbb_topics (topic_id, forum_id, icon_id, topic_attachment, topic_approved, topic_reported, topic_title, topic_poster, topic_time, topic_time_limit, topic_views, topic_replies, topic_replies_real, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, topic_moved_id, topic_bumped, topic_bumper, poll_title, poll_start, poll_length, poll_max_options, poll_last_vote, poll_vote_change)
select topic_id, forum_id, icon_id, topic_attachment, topic_approved, topic_reported, topic_title, topic_poster, topic_time, topic_time_limit, topic_views, topic_replies, topic_replies_real, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, topic_moved_id, topic_bumped, topic_bumper, poll_title, poll_start, poll_length, poll_max_options, poll_last_vote, poll_vote_change from phpbb_topics_2;

INSERT INTO phpbb_posts (post_id, topic_id, forum_id, poster_id, icon_id, poster_ip, post_time, post_approved, post_reported, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, post_username, post_subject, post_text, post_checksum, post_attachment, bbcode_bitfield, bbcode_uid, post_postcount, post_edit_time, post_edit_reason, post_edit_user, post_edit_count, post_edit_locked)
select post_id, topic_id, forum_id, poster_id, icon_id, poster_ip, post_time, post_approved, post_reported, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, post_username, post_subject, post_text, post_checksum, post_attachment, bbcode_bitfield, bbcode_uid, post_postcount, post_edit_time, post_edit_reason, post_edit_user, post_edit_count, post_edit_locked from phpbb_posts_2;

------------ END OF MERGE STUFF ------------


------------ POLLS ------------

UPDATE phpbb_poll_options_2 SET topic_id = topic_id + max_topic_id;

UPDATE phpbb_poll_votes_2 SET topic_id = topic_id + max_topic_id;

UPDATE phpbb_poll_votes_2 SET vote_user_id = vote_user_id + max_user_id;

UPDATE phpbb_poll_votes_2, phpbb_users_2
SET phpbb_poll_votes_2.vote_user_id = phpbb_users_2.user_id
WHERE phpbb_poll_votes_2.vote_user_id = phpbb_users_2.user_id_old;

INSERT INTO phpbb_poll_options (poll_option_id, topic_id, poll_option_text, poll_option_total) SELECT poll_option_id, topic_id, poll_option_text, poll_option_total FROM phpbb_poll_options_2;

INSERT INTO phpbb_poll_votes (topic_id, poll_option_id, vote_user_id, vote_user_ip) SELECT topic_id, poll_option_id, vote_user_id, vote_user_ip FROM phpbb_poll_votes_2;

------------ END OF POLLS ------------


------------ DRAFTS ------------

ALTER TABLE phpbb_drafts_2 CHANGE `draft_id` `draft_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;
ALTER TABLE phpbb_drafts_2 DROP PRIMARY KEY;

UPDATE phpbb_drafts_2 SET draft_id = draft_id + max_draft_id, user_id = user_id + max_user_id;
UPDATE phpbb_drafts_2 SET topic_id = topic_id + max_topic_id WHERE topic_id > 0;
UPDATE phpbb_drafts_2 SET forum_id = forum_id + max_forum_id WHERE forum_id > 0;

update phpbb_drafts_2, phpbb_users_2
set phpbb_drafts_2.user_id = phpbb_users_2.user_id
where phpbb_drafts_2.user_id = phpbb_users_2.user_id_old;

INSERT INTO phpbb_drafts (draft_id, user_id, topic_id, forum_id, save_time, draft_subject, draft_message) SELECT draft_id, user_id, topic_id, forum_id, save_time, draft_subject, draft_message FROM phpbb_drafts_2;

------------ END OF DRAFTS ------------


------------ BOOKMARKS ------------

UPDATE phpbb_bookmarks_2 SET topic_id = topic_id + max_topic_id, user_id = user_id + max_user_id;

update phpbb_bookmarks_2, phpbb_users_2
set phpbb_bookmarks_2.user_id = phpbb_users_2.user_id
where phpbb_bookmarks_2.user_id = phpbb_users_2.user_id_old;

INSERT INTO phpbb_bookmarks (topic_id, user_id) SELECT topic_id, user_id FROM phpbb_bookmarks_2;

------------ END OF BOOKMARKS ------------


------------ ATTACHMENTS, PART 1 ------------

ALTER TABLE phpbb_attachments_2 CHANGE `attach_id` `attach_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;
ALTER TABLE phpbb_attachments_2 DROP PRIMARY KEY;

UPDATE phpbb_attachments_2 SET attach_id = attach_id + max_attach_id, poster_id = poster_id + max_user_id;
UPDATE phpbb_attachments_2 SET topic_id = topic_id + max_topic_id, post_msg_id = post_msg_id + max_post_id WHERE in_message = 0;
UPDATE phpbb_attachments_2 SET post_msg_id = post_msg_id + max_pm_id WHERE in_message = 1;

UPDATE phpbb_attachments_2, phpbb_users_2
SET phpbb_attachments_2.poster_id = phpbb_users_2.user_id
WHERE phpbb_attachments_2.poster_id = phpbb_users_2.user_id_old;

------------ END OF ATTACHMENTS, PART 1 ------------


Run script3.php. Save the script output to a file somewhere (notepad).
Be careful to run the script ONCE ONLY.
Copy the whole the script output and paste it into the renaming tool (see below), and let it rename the files for you.


------------ ATTACHMENTS, PART 2 ------------

INSERT INTO phpbb_attachments (attach_id, post_msg_id, topic_id, in_message, poster_id, is_orphan, physical_filename, real_filename, download_count, attach_comment, extension, mimetype, filesize, filetime, thumbnail) SELECT attach_id, post_msg_id, topic_id, in_message, poster_id, is_orphan, physical_filename, real_filename, download_count, attach_comment, extension, mimetype, filesize, filetime, thumbnail FROM phpbb_attachments_2;

------------ END OF ATTACHMENTS, PART 2 ------------


------------ FIX GROUPS ------------

delete from `phpbb_user_group` where group_id = reg_user_group_id;
insert into phpbb_user_group (group_id, user_id, group_leader, user_pending) select reg_user_group_id, user_id, 0, 0 from phpbb_users WHERE user_type <> 2;

------------ END OF FIX GROUPS ------------


The avatars don't need any query.
Run script2.php. Save the script output to a file somewhere (notepad).
Be careful to run the script ONCE ONLY.
Copy the whole the script output and paste it into the renaming tool (see below), and let it rename the files for you.

--- FINAL NOTES ---

One year and a half later, I can say that the merging I performed was perfect with no noticeable problems (except for smilies not being merged). There are some small problems that are not solved by this procedure, which I found and fixed by hand later. None of them were critical. Some of them are the following:

"Duplicate bots!!"
This is what my note says. I don't remember anything about that, probably it just means that the bots from the old forum are copied (and they shouldn't). Shouldn't be difficult to delete them with a query.

-Fix ranks!
If I remember correctly, the merged users will not have the automatic ranks of the new forum. I don't remember how I solved that, maybe with a query.

When I have time, I will re-merge the forum again and verify that these steps are complete.

Congratulations, you are done!

Paolo Antonucci
Kullanıcı avatarı
Ademx33
Kayıtlı Kullanıcı
Mesajlar: 595
Kayıt: 25.05.2008, 06:04
Konum: // Karaman //
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen Ademx33 »

Öncelikle bu konuya bakın: https://www.phpbb.com/community/viewtop ... &t=1917165
Ve özellikle de bu konuya : https://www.phpbb.com/community/viewtop ... #p13251640

Şunu unutmayın ki eğer sonraki sürümlerde veritabanı şeması değişmişse sorgular güncel olmayabilir.
Lütfen “büyük birleştirme sorguları”nda sütun listelerinin tam ve doğru olup olmadığını kontrol edin.

Eğer vaktim olursa ileride tam ve iyi yazılmış bir rehber hazırlayacağım ama şimdilik kabaca yapılacakları listeleyeyim.

• Başlangıç olarak konu içinde mesajlarından kopyala yapıştır yaptığım Brudertorgen e teşekkür ederim.
• Bu öğretici konuya ekli 3 php yazılımı vardır. Onları yazdığı için Giacomo Drago ya teşekkür ederim. Onları açıp veritabanı isminizi, kullanıcı adınızı ve şifrenizi yazarak doldurmalısınız.
• Ayrıca bu resim, avatar dosyaları ve eklerin isimlerini değiştirmek için bir araç vardır. (PhpBB yolu sakladığı için bu gereklidir. Maalesef sadece Windows içindir. VB.NET kaynak kodları eklenmiştir )

--------------- HADİ BAŞLAYALIM (Bismillah)---------------
1 : Öncelikle
PhpMyAdmin den eski veritabanına ulaşıp aşağıdaki değişiklikleri yapın.

RENAME TABLO : TABLO İSMİNİ DEĞİŞTİR DEMEK TO dan sonraki şekle sokacaksın.
Örneğin
TABLO İSMİNİ : phpbb_attachments TEN phpbb_attachments_2; YE DEĞİŞTİRİN
---------------------------
RENAME TABLE phpbb_attachments TO phpbb_attachments_2;
RENAME TABLE phpbb_bookmarks TO phpbb_bookmarks_2;
RENAME TABLE phpbb_config TO phpbb_config_2;
RENAME TABLE phpbb_drafts TO phpbb_drafts_2;
RENAME TABLE phpbb_forums TO phpbb_forums_2;
RENAME TABLE phpbb_poll_options TO phpbb_poll_options_2;
RENAME TABLE phpbb_poll_votes TO phpbb_poll_votes_2;
RENAME TABLE phpbb_posts TO phpbb_posts_2;
RENAME TABLE phpbb_privmsgs TO phpbb_privmsgs_2;
RENAME TABLE phpbb_privmsgs_to TO phpbb_privmsgs_to_2;
RENAME TABLE phpbb_smilies TO phpbb_smilies_2;
RENAME TABLE phpbb_topics TO phpbb_topics_2;
RENAME TABLE phpbb_users TO phpbb_users_2;

2 : Bütün tabloları boşaltın ve sonra YENİDEN İSİMLENDİREREK eski orijinal isimlerine döndürün.

RENAME TABLO : TABLO İSMİNİ DEĞİŞTİR DEMEK TO dan sonraki şekle sokacaksın.
Örneğin
TABLO İSMİNİ : phpbb_attachments_2 DAN phpbb_attachments; E DEĞİŞTİRİN
RENAME TABLE phpbb_attachments_2 TO phpbb_attachments;
--------------
RENAME TABLE phpbb_attachments_2 TO phpbb_attachments;
RENAME TABLE phpbb_bookmarks_2 TO phpbb_bookmarks;
RENAME TABLE phpbb_config_2 TO phpbb_config;
RENAME TABLE phpbb_drafts_2 TO phpbb_drafts;
RENAME TABLE phpbb_forums_2 TO phpbb_forums;
RENAME TABLE phpbb_poll_options_2 TO phpbb_poll_options;
RENAME TABLE phpbb_poll_votes_2 TO phpbb_poll_votes;
RENAME TABLE phpbb_posts_2 TO phpbb_posts;
RENAME TABLE phpbb_privmsgs_2 TO phpbb_privmsgs;
RENAME TABLE phpbb_privmsgs_to_2 TO phpbb_privmsgs_to;
RENAME TABLE phpbb_smilies_2 TO phpbb_smilies;
RENAME TABLE phpbb_topics_2 TO phpbb_topics;
RENAME TABLE phpbb_users_2 TO phpbb_users;

3: Bunları yeni veritabanına aktarın. ŞİMDİ bu yeni veritabanın bir YEDEĞİNİ ALIN ki eğer birşeyler yanlış giderse yeniden başlayabileceğiniz ilk basamağınız olsun.

4: İşte bütün sorgular.
AŞAĞIDAKİLERİ OKUYUP NOT ALIN
(Burada büyük harfle verilen SELECT = SEÇ demek. Bir cümlesini çevireyim sen kalanını aynı yoldan yap )
Örneğin:
SELECT MAX( user_id ) FROM phpbb_users; --> max_user_id
phpbb_users; --> max_user_id DEN MAXİMUM KULLANICI SAYISINI SEÇ. gibi
---------------------------------------------------------------------------

SELECT MAX( user_id ) FROM phpbb_users; --> max_user_id
SELECT MAX( msg_id ) FROM phpbb_privmsgs; --> max_pm_id
SELECT MAX( forum_id ) FROM phpbb_forums; --> max_forum_id
SELECT MAX( right_id ) FROM phpbb_forums; --> max_right_id
SELECT MAX( topic_id ) FROM phpbb_topics; --> max_topic_id
SELECT MAX( post_id ) FROM phpbb_posts; --> max_post_id
SELECT MAX( draft_id ) FROM phpbb_drafts; --> max_draft_id
SELECT MAX( attach_id ) FROM phpbb_attachments; -> max_attach_id

SELECT config_value FROM `phpbb_config_2` WHERE config_name LIKE 'avatar_salt'; --> Old avatar salt (for the renaming tool)
SELECT config_value FROM `phpbb_config` WHERE config_name LIKE 'avatar_salt'; --> New avatar salt (for the renaming tool)

SELECT group_id FROM `phpbb_groups` WHERE group_name ='REGISTERED'; --> reg_users_group_id

Bundan sonra gördüğün her Max_user_id, veya max_draft_id vb. sorgularda not aldığın değerlerle değiştirmelisin. Bunun için BUL-DEĞİŞTİR metodunu kullanabilirsin.
-------------------------------
------------ USERS = KULLANICILAR------------

“MEDIUMINT diye bir kelime yok İngilizcede. İki kelimenin birleştirilmesiyle oluşturulmuş bir php tabiriymiş anlaşılan. Medium = Orta demek , int ise integer=tamsayı kelimesinin kısaltması. Ne demek istediği pek te anlaşılmıyor. Mod konusuna yabancı olduğumdan olabilir. ORTA TAMSAYI gibi alakasız bir anlam ortaya çıkıyor.
Son olarak bir denersek
alter table phpbb_users_2 add user_id_old mediumint(8);

• table phpbb_users_2 TABLOSUNU DEĞİŞTİR –EKLE user_id_old mediumint(8);


ALTER TABLE phpbb_users_2 CHANGE `user_id` `user_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL;

• phpbb_users_2 TABLOSUNU DEĞİŞTİR `user_id` `user_id` MEDIUMINT( 8 ) YAP. İŞARETSİZ BOŞ BIRAKMA gibi bişey demiş.
•


Kardeş benden bu kadar. Koca bir mod veya metni tümden çevirmeye kalkmak zor ve çok sıkıcı oluyor. Buraya kadar bir ilerleme kaydedersen takıldığın yerlerle ilgili bölüm bölüm yaz sorularını ben veya bir başkası yardım etmek isterse daha kolay olur zannımca. İleride editleyerek düzgün eklemeler yapabilirim ama şimdilik ben kaçar iyi geceler.
----------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------------
Mesaj No : 551
Forever PhpBB3 - Http://www.PhpBBTurkey.Com sayesinde kendi phpbb3 sitemi kurabildim.

Sağ üst köşede ARAMA bölümü var aklınıza takılan her türlü sorununuzu oraya yazarsanız uğraşmak zorunda kalmazsınız...
AkrepKral
Kayıtlı Kullanıcı
Mesajlar: 32
Kayıt: 07.01.2006, 23:58
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen AkrepKral »

Teşekkürler AdemX33 çok makbule geçti, ellerine ve emeklerine sağlık. Sonucu buradan iletirim
AkrepKral
Kayıtlı Kullanıcı
Mesajlar: 32
Kayıt: 07.01.2006, 23:58
İletişim:

Re: İki forumu birleştirmek

Mesaj gönderen AkrepKral »

Eksik bir şeyler var sanki. Neden tek bir db üzerinde hiçbir birleştirme yapmadan tablo adları değiştiriliyor ve sonra boşaltılıyor? Boşaltılan tablolardaki bilgiler nasıl kullanılacak?
Çevirdiğin kısımlarda iki veritabanının birleştirilmesi ile ilgili bir bölüm yok.

Yanlış anlamadı isem şu şekilde olması gerekmiyor mu?

1- Yüklü veritabanındaki belli tabloların adları değiştirilecek
2- Diğer veritabanı yüklenecek
3- Adları değiştirilen tablolar eski haline getirilecek (Tabi oluyorsa)
Kilitli

“3.0.x Destek Forumu” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Bing [Bot] ve 2 misafir