Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 11-28-2012, 05:26 PM
SToP_GAP SToP_GAP is offline
 
Join Date: May 2012
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So to sum up for anyone else in the same situation, this is what I did to clone the database:

Switch off the forum from the admin panel->options->Turn Your vBulletin On and Off

use mysqldump to copy out the existing database:
Code:
mysqldump -h [server_ip_here] -u [user] -p[password] [database_name_here] > liveforumdump.sql
(for most people, server_ip_here will just need to be localhost however if you are connecting to a database on a remote machine via an IP address this will need to go here)

copy the entire forum root folder, including owner and groups
Code:
cp -a /pathtosourcefolder /pathtodestfolder
If you forget to use the -a (archive) option then you may need to chown the files to the apache/lighttpd/(whichever webserver user) account on your system.

Next create a new database to house the duplicate in:
log in to mysql as root (or other suitably privileged user):
Code:
mysql -u root -p
From the mysql command prompt:
Code:
CREATE DATABASE cloned_forum_db_name;
Next give this account a new user:
Code:
GRANT ALL PRIVILEGES ON cloned_forum_db_name.* TO clone_user@localhost IDENTIFIED BY 'password_here';
Exit mysql prompt
Code:
quit
Now restore the liveforum.sql to the new database:
Code:
mysql -u root -p cloned_forum_db_name < liveforumdump.sql
Next you must edit clonedforumfolder/includes/config.php

Make sure that you change the following lines to match the user, database and passwords which you have used in the previous steps:
Code:
$config['Database']['dbname'] = 'cloned_forum_db_name';
$config['MasterServer']['username'] = 'clone_user';
$config['MasterServer']['password'] = 'password_here';
You may also need to alter:
Code:
$config['Misc']['forumpath'] = 'forum_root_path_here';
$config['Misc']['cookieprefix'] = 'cookie_prefix_here';
$config['Datastore']['class'] = 'vB_Datastore_Filecache';
$config['Datastore']['prefix'] = 'datastore_prefix_here';
It is possible that you will need to alter the cache type - if XCache was selected for example then both forums will be trying to share the same cache files and you will get the same conflicts that I wrote about earlier in this thread. In theory, simply changing the cache prefix should be sufficient to fix this.

You may also need to change the settings under:
admin->settings->options->Site Name / URL / Contact Details
if they don't automatically reflect the new path etc. that you enter in config.php

Finally, if you want to put this new copy in development mode you can set:
Code:
$config['Misc']['debug'] = true;
A reboot may be required but that should be all that you need to get your forum cloned to run as a development copy. I hope this helps someone else too.

Don't forget to switch your main forum back on afterwards!
Reply With Quote
Благодарность от:
Lynne
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06713 seconds
  • Memory Usage 2,173KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_box
  • (1)post_thanks_box_bit
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete