To clone whole forum to another site

Started by Neverhurry, May 22, 2010, 11:54:38 AM

Previous topic - Next topic

Neverhurry

Hi, I have a problem. I need to split my forum into two parts, but I know that will be very difficult. So I would like to ask this question.

My forum is now at xyz.tld, and i want to extract all most half of the content (one board on photography) to abc.tld. So I can clone the whole forum from xyz.tld to abc.tld, and there in abc.tld i will manually delele all the topics and posts outside of that photography board, thus i will get a forum with only the photography board content, and the same members. Is it possible or simply a fantasy? If it is possible, how difficult is the clone process? Any help will be highly appreciated!!!
I am using SMF 2.0.1, curve themes.

CapadY

Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

busterone

I have done it, and it is really rather simple.
Copy the entire file structure of your original forum to your new domain's web space/directory. Export a backup of your active database. Import that backup to a new db on the new domain. Then upload repair_settings.php to the root of your new forum domain and run it from your browser. Ensure the DB info, urls and paths are correct, and even change the forum's name if you plan to. Once it is completed, you can log in to your new forum. Then go to admin- Themes Settings to make sure any other theme's urls and paths are correct as well. Repair_settings.php will repair the default theme urls and paths only. You must do the additional ones manually.
Then, IF you are using a recycle bin, it is advisable to disable it while you delete boards and topics. If not, it will make you work much harder and longer. Go into the Admin CP and simply delete all the boards that you want to eliminate, leaving only the photography board.
After all boards and topics are deleted, it is also advisable to run the admin db maintenance tasks. (optimize tables, check for errors, etc.) Then re-activate the recycle bin if you are using it.
You will have a new forum with the one photography board and retain all the members of the original forum.

Neverhurry

Oh, thanks sooooooo much.

In "How do I restore the database data? " I read "The name of the new database should be the same name as the old database. " , but I can not have 2 databases with the same name in the same server (because I am not going to change host), that is the last thing which troubles me. busterone, when you did that, did you have to create a new database with the same name as the old database?
I am using SMF 2.0.1, curve themes.

flapjack

it's not possible to have two databases with the same name, however you could use one database and change the prefix of second installation from smf_ to something else.

HOWEVER, this will need some precautions and supervision to make it work. if you decide to give it a go today, I will be happy to assist you with it (I have some time to spare), let me know. (FYI: I've done it multiple times with 100% success rate)

if you decide not to go for it, here's the outline what you have to do:
- make a backup of the database (or two of them, just in case)
- get some proper text editor  (like Notepad++)
- replace all smf_ prefixes with other (for example smf2_) in tables names. keep in mind that if you are using any mods, there might be some problems (I am refering to Aeva Media here, which I remember gave me some trouble before)
- using ftp software create a copy of your current installation
- import changed database
- use repair_settings.php
- fix your attachments/avatars path, themes path, and smileys
- enjoy your newly created copy :)

Neverhurry

Wow, you are so friendly. I will give it try tomorrrow since it is too late. Bed time now. But thanks so much for the useful suggestion. Good nite.
I am using SMF 2.0.1, curve themes.

Neverhurry

flapjack,  why is that "replace all smf_ prefixes with other (for example smf2_) in tables names", I thought there is no need to change the prefixes.
I am using SMF 2.0.1, curve themes.

flapjack

well, you either use two databases or one with both forums using different prefixes. you cannot just merge tables, as this will make your forum unusable

Neverhurry

While import the sql file i got this error:

Error

SQL query:

INSERT INTO `smf_log_search_subjects` (`word`, `id_topic`) VALUES ('xxxx', 426), ('xxxx', 121), ('xxxx', 88), ('xxxx', 2137), ('xxxx', 747), ('xxxx', 598), ('xxxx', 1942), ('xxxx', 1511), ('xxxx', 1717), ('xxxx', 1584), ('xxxx', 592), ('xxxx', 1667), ('xxxx', 1104), ('xxxx(一', 1490), ('xxxx ', 1162), ('xxxx', 45), ('xxxx', 1766), ('xxxx', 1415), ('xxxx', 1982), ('xxxx', 1657), ('xxxx', 1611), ('xxxx', 803), ('xxxx', 807), ('xxxx', 1889), ('xxxx', 1835), ('xxxx', 1641), ('xxxx', 2077), ('xxxx', 818), ('xxxx', 1567), ('xxxx', 1768), ('xxxx?', 2113), ('xxxx', 55), ('xxxx', 1484), ('xxxx', 979), ('�[...]

MySQL said: Documentation
#1062 - Duplicate entry '?-807' for key 1


Can anybody help me?
I am using SMF 2.0.1, curve themes.

Neverhurry

I tried another way: export database to a sql file and then import this file to the new db by phpMyAdmin, but i had this error:

Error

SQL query:

-- -- Dumping data for table `smf_admin_info_files` -- INSERT INTO `smf_admin_info_files` (`id_file`, `filename`, `path`, `parameters`, `data`, `filetype`) VALUES (1, 'current-version.js', '/smf/', 'version=%3$s', 'window.smfVersion = "SMF 2.0 RC3";', 'text/javascript'), (2, 'detailed-version.js', '/smf/', 'language=%1$s&version=%3$s', 'window.smfVersions = {\n ''SMF'': ''SMF 2.0 RC3'',\n ''SourcesAdmin.php'': ''2.0 RC3'',\n ''SourcesBoardIndex.php'': ''2.0 RC3'',\n ''SourcesCalendar.php'': ''2.0 RC3'',\n ''SourcesClass-Graphics.php'': ''2.0 RC3'',\n ''SourcesClass-Package.php'': ''2.0 RC3'',\n ''SourcesDbExtra-mysql.php'': ''2.0 RC3'',\n ''SourcesDbExtra-postgresql.php'': ''2.0 RC3'',\n ''SourcesDbExtra-sqlite.php'': ''2.0 RC3'',\n ''SourcesDbPackages-mysql.php'': ''2.0 RC3'',\n ''SourcesDbPackages-postgresql.php'': ''2.0 RC3'',\n ''SourcesDbPackages-sqlite.php'': ''2.0 RC3'',\n ''SourcesDbSearch-mysql.php'': ''2.0 RC3'',\n ''SourcesDbSearch-postgresql.php'': ''2.0 RC3'',\n ''Sourc[...]

MySQL said: Documentation
#1062 - Duplicate entry '1' for key 1


If somebody knows how to solve this problem, please help! Thank you!
I am using SMF 2.0.1, curve themes.


Neverhurry

I use EditPlus, it should be safe. I read that it may have something to do with the tables auto increment value.
http://www.simplemachines.org/community/index.php?topic=328941.0
I am using SMF 2.0.1, curve themes.

CapadY

Are you sure the tables are empty before restoring the data ?

You don't try to restore the same table twice ?

This is an problem with keyfields. Often a auto-increment field but can be other.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Neverhurry

Quote from: capady on May 23, 2010, 05:05:18 PM
Are you sure the tables are empty before restoring the data ?

You don't try to restore the same table twice ?

This is an problem with keyfields. Often a auto-increment field but can be other.

thanks.
I had been importing to an empty database, so no twice issue.
I deleted all the smf_log_search_subjects tables, and it is successful.

But I have another language problem.  :'( Look:

http://www.simplemachines.org/community/index.php?topic=383042.0;topicseen
I am using SMF 2.0.1, curve themes.

Advertisement: