how do i clone the live database (for my new system) ...

Started by aegersz, October 05, 2015, 09:56:57 AM

Previous topic - Next topic

aegersz

... and how do i avoid a possible prefix name duplication clash ?

(re. I'd like to clone my existing live database but with another name so my fresh system can use it)

i am building a fresh system on my live server but i tried one method of cloning, which worked but i noticed the smf installer said to AVOID duplicate table prefix names.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Kindred

1- use different prefixes.... but that makes cleanup harder, in the end, IMO.
2- use a different database
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

aegersz

i setup a smfclone database, edited the backup of smf209 and altered the prefix to smfclone_, changed Settings.php but only to have it fail with:

the dreaded white screen.

am i in doing this right ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

it finally did work - i just had to export it (the clone), drop the db then import it, back.

crazy but it works.

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

then i lost it again (it worked momentarily byt stopped when finished building tables.

do you recommend me running a clone at all ?

the live system is touch there but my dev. box is ok.

weird. things work in differently in similar environments - it's got me puzzled.

maybe a reboot helps ? if i change the database name and prefix via Admin then it works for a while but then goes white screen.

please, what do you thing is causing my instability ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Kindred

It really sounds like you have some serious server issues.

Why are you attempting to run a clone anyway?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

aegersz

i want to refresh my live system (to get the mod all on properly as i have made too many manual changes and now mods won't come off etc.) so i am building a clone.

but it is working - i just needed to start installing mods (the SA Facebook one has it's hooks in deep) and it (the database) kicked in properly and stayed up.

marking as solved.

i am not happy about the integrity of the live system's Source dir. (going back to my segmentation faults issue with Sources etc.) so i thought i would build a clone and then run with that.

the mods work so well on a fresh system :)
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

just in case you wondered where my site was at:

old system, bloated and confused > http://forum.drugs-and-users.org

new system: slim, tidy and simple  > http://forum.drugs-and-users.org/smfnew
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Steve

DO NOT pm me for support!

aegersz

yes but I'm too worried about breaking the site so I have been removing some mods and reinstalling some too.

this is my live system and I had to sort out missing mod components when I was hitting my new system only.

yes, mod management on my new system affected the live system so now I'm leaving it alone, possibly waiting on a huge database.

I'm confused and have got my system patched up again.

I had issues with facebook integration, mainly but lost a Shout Box mod.

I suggest forgetting the Facebook integeation and the social login mods.

but it's stable now on all systems.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Gluz

So, you want to clone the database and the files to make an online test forum? or just start with a fresh install but with all your content (users, posts, etc.) in it to install mods and tweak it a little?

Anyway, the way I create my online test sites is this way: to make a simple clone of the database just go to export in phpMyAdmin, the Export Method in custom should show all the options, then untick "Add CREATE DATABASE", this way the exported backup just run all the SQL statements plain in the current database, so if you create a new database for the forum and with that selected you import the backup it should populate your new database with all the data of your main database, then assign some user to that database and you are done, a clone of your database in another database so they don't interfere between them. Then just copy all the files in the FTP (easy in the cPanel file manager, copy the whole folder at once to the test folder) and run repair_settings.

If you want to start fresh, one way is make an exact clone, then uninstall all the mods and upload a fresh set of files, and start with the whole process of installing Themes and then MODs and tweaks.

aegersz

thanks but i managed to clone the live database and have got it running.

i had to CREATE it, USE it and set SOURCE after i used nano's "Ctril +\" find and replace function to change the table prefix first.

it's working well despite it causing issues on my LIVE system after reinstall mods on my NEW system after the database was cloned. i fixed the issues on my live system by forcing the mods to uninstall and then reinstalling them, it was worrying at the time because my system is so dependent on mods.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

I have automated this, for anybody interested, so here is the batch file. it runs hourly.

Quote
#!/bin/bash

echo Unload the current database
# Unload the current database
mysqldump -u root -p**** smf209 > /SQL/database_smf209_`date '+%d-%m-%Y'`.sql

echo Convert the table prefix to the clone
# Convert the table prefix to the clone
sed 's/`smf209_/`smfclone1_/g' /SQL/database_smf209_`date '+%d-%m-%Y'`.sql > /SQL/smfclone1.sql

echo Drop and Recreate the clone database
# Drop and Recreate the clone database
mysql -u root -p**** < /root/data/mysql.batch

echo Reload the clone database
# Reload the clone database
mysql -u root -p**** smfclone1 < /SQL/smfclone1.sql

mysql.batch:

Quote
drop database smfclone1;
create database smfclone1;
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

note to self and others attempting this on the same system:

don't forget to run repair_settings.php on the clone system otherwise any maintenance will hit the live system ... don't learn like i did - the HARD way.

thanks to SMF Support staff for explaining that the database also contains pointers to the live directory and the onus is on the cloned system to re-establish the correct directory paths.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: