How to clear database when making copy of site
Go to page 1, 2  Next  :| |:
-> New installations

#1: How to clear database when making copy of site Author: GeraldLocation: Asheville, NC PostPosted: Sat Aug 05, 2006 4:55 am
    ----
Hi,Folks,
Hee my question, I coppied my site and database to a new url and all is good afetr the config and database edit for that. But what i need to do is run some kind of MySql comand that will "clear" the database without changing any tables or vaules for the tables. I'm not sure if I'm using the correct terms for mysql issues but I hop you get my meaning.

I have been doing some by hand but thats taking for ever. If anyones got the comand for something like this please let me lnow.

ps: I'm kin of scarded t work on the database with out some good help Smile

#2: Re: How to clear database when making copy of site Author: GeraldLocation: Asheville, NC PostPosted: Sat Aug 05, 2006 2:09 pm
    ----
I have been searching the forums and nothing - Maybe I'm not searching the correct terms or something, not sure because I do'nt know what I'm doing. I think I'm screwed Smile

#3: Re: How to clear database when making copy of site Author: DizfunkshunalLocation: Some where over the rainbow PostPosted: Sat Aug 05, 2006 2:35 pm
    ----
to clarify you want to keep the tables butyou want to delete all the info insideeach table?

#4: Re: How to clear database when making copy of site Author: GeraldLocation: Asheville, NC PostPosted: Sat Aug 05, 2006 2:38 pm
    ----
Hi,
Yes content from the other site it was used on.

#5: Re: How to clear database when making copy of site Author: DizfunkshunalLocation: Some where over the rainbow PostPosted: Sat Aug 05, 2006 3:23 pm
    ----
go into phpmyadmin
select database in question
check mark all tables
littledrop down menu at bottom beside checkall/uncheck all select empty

then click go then when page refreshes click yes

#6: Re: How to clear database when making copy of site Author: DizfunkshunalLocation: Some where over the rainbow PostPosted: Sat Aug 05, 2006 3:24 pm
    ----
Dizfunkshunal wrote:
go into phpmyadmin
select database in question
check mark all tables
littledrop down menu at bottom beside checkall/uncheck all select empty

then click go then when page refreshes click yes

if you wantto keep your users then do not check the box beside your user tables

#7: Re: How to clear database when making copy of site Author: alvaLocation: The Netherlands PostPosted: Sat Aug 05, 2006 3:33 pm
    ----
If you want a working website then don't this. Just run the installer to create a new system. (use a different prefix)

Clearing things like version num, superuser-info, systemblocks or any other important values that are inserted on clean installs doesn't sound like a good idea to me.

#8: Re: How to clear database when making copy of site Author: alvaLocation: The Netherlands PostPosted: Sat Aug 05, 2006 3:37 pm
    ----
Gerald wrote:
"clear" the database without changing any tables or vaules for the tables

based on your earlier response I'm assuming you mean without changing any tables or columns, but with clearing values that represent website content.

(Why did you copy your database in the first place? Why not run the installer to create a fresh system?)

#9: Re: How to clear database when making copy of site Author: DizfunkshunalLocation: Some where over the rainbow PostPosted: Sat Aug 05, 2006 3:55 pm
    ----
what i said to do above wouldntchange the table would it. itshould just empty them? of course i can see a few table now that you wouldnt want to empty

#10: Re: How to clear database when making copy of site Author: alvaLocation: The Netherlands PostPosted: Sat Aug 05, 2006 4:39 pm
    ----
Dizfunkshunal wrote:
what i said to do above wouldntchange the table would it. itshould just empty them?

I don't know, my version of phpMyAdmin doesn't have an option to empty all fields of all tables.

Quote::
of course i can see a few table now that you wouldnt want to empty

Emptying a table still sounds to me as if you want to drop all columns instead of changing all values in those fields to an empty value/default values.

#11: Re: How to clear database when making copy of site Author: DizfunkshunalLocation: Some where over the rainbow PostPosted: Sat Aug 05, 2006 4:52 pm
    ----
ok well i dont recommend emtpieingall thetables either now lol I treid it on a test site and now i get a database error no more site to keep it simple i would recommend a fresh install then import your user able so that they do nothaveto reregister.

#12: Re: How to clear database when making copy of site Author: GeraldLocation: Asheville, NC PostPosted: Sat Aug 05, 2006 9:34 pm
    ----
Hi alva,
I coppied my database because the site it came from was 2 years in the building and had all the modules and custom work I put in to it and I didn't want to do the work over.

And yes I DID NOT run the mysql clear all feature that would have been a mess, thanks for responding Dizfunkshunal but I may have not been clear on that.

I have got most of the database cleaned out BUT I have an issue now.

For some reason my index page will not load - every other page will but not the index. All other page work when I'm sign in as admin, user or not at all. Just no index very od.

#13: Re: How to clear database when making copy of site Author: GeraldLocation: Asheville, NC PostPosted: Sat Aug 05, 2006 9:48 pm
    ----
Well I was thinking I was okay but now I have one small issue with my forums center block - but I can fix that later.

What i have done is get to know my DB a bit better by spending some time in there looking at all the tables and structories, very nice!

#14: Re: How to clear database when making copy of site Author: GeraldLocation: Asheville, NC PostPosted: Sat Aug 05, 2006 9:54 pm
    ----
This is the error message sent to me by the system:



While executing query "SELECT
p.post_time, t.topic_id, t.forum_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_type, t.topic_status,
t.topic_last_post_id, t.topic_first_post_id, t.topic_moved_id, t.topic_attachment, t.icon_id,
f.forum_id, f.forum_name, f.auth_read, n.notify_status,
u.username, u.user_posts, v.username, v.user_posts, w.poster_ip, i.icon_url,
p.poster_id, p.poster_ip, p.post_id, s.post_text, m.custom_title
FROM cms_bbtopics t, cms_bbforums f
LEFT JOIN cms_bbposts p ON (p.post_id=t.topic_last_post_id)
LEFT JOIN cms_bbposts w ON (w.post_id=t.topic_first_post_id)
LEFT JOIN cms_users u ON (u.user_id=p.poster_id)
LEFT JOIN cms_users v ON (v.user_id=t.topic_poster)
LEFT JOIN cms_bbtopics_watch n ON (n.user_id= AND n.topic_id=t.topic_id)
LEFT JOIN cms_bbtopic_icons i ON (i.icon_id=t.icon_id)
LEFT JOIN cms_bbposts_text s ON (s.post_id=t.topic_last_post_id)
LEFT JOIN cms_modules m ON (m.title="Forums") WHERE t.forum_id=f.forum_id AND t.topic_moved_id=0
ORDER BY p.post_time DESC LIMIT 5"

the following error occured: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND n.topic_id=t.topic_id)
LEFT JOIN cms_bbtopic_icons i ON

In: /home/wncana.org/www/wncana.org/narcotics-anonymous/blocks/block-Forums_Centre_Block_(Module).php on line:




I turnned off the forums center block module and the error has gone and the index loads now. Any ideras?

#15: Re: How to clear database when making copy of site Author: DizfunkshunalLocation: Some where over the rainbow PostPosted: Sat Aug 05, 2006 10:04 pm
    ----
what is your goal in doing all this? to create a new site but retain all user accounts?



-> New installations

All times are GMT

Go to page 1, 2  Next  :| |:
Page 1 of 2