vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Cloned forum/database changing bburl of one affects both - what's going on? (https://vborg.vbsupport.ru/showthread.php?t=292003)

SToP_GAP 11-28-2012 05:26 PM

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! :)


All times are GMT. The time now is 03:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00992 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete