Support ⇒ New installations :: Archives ⇒ How to clear database when making copy of site :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS

Archived ⇒ How to clear database when making copy of site Revive this topic

Go to page 1, 2 Next
Author Message
Gerald
Supporter

Offline Offline
Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

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

_________________
Gerald Scott
Asheville, NC US

Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
View user's profileVisit poster's websitePhoto Gallery
Gerald
Supporter

Offline Offline
Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

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

_________________
Gerald Scott
Asheville, NC US

Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
View user's profileVisit poster's websitePhoto Gallery
Dizfunkshunal
Platinum Supporter

Offline Offline
Joined: Mar 23, 2006
Posts: 2179
Location: Some where over the rainbow

to clarify you want to keep the tables butyou want to delete all the info insideeach table?

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
View user's profileSend e-mailVisit poster's websiteYahoo Messenger
Gerald
Supporter

Offline Offline
Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

Hi,
Yes content from the other site it was used on.


Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
View user's profileVisit poster's websitePhoto Gallery
Dizfunkshunal
Platinum Supporter

Offline Offline
Joined: Mar 23, 2006
Posts: 2179
Location: Some where over the rainbow

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

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
View user's profileSend e-mailVisit poster's websiteYahoo Messenger
Dizfunkshunal
Platinum Supporter

Offline Offline
Joined: Mar 23, 2006
Posts: 2179
Location: Some where over the rainbow

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

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
View user's profileSend e-mailVisit poster's websiteYahoo Messenger
alva
1000+ Posts Club

Offline Offline
Joined: May 31, 2005
Posts: 1150
Location: The Netherlands

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.


alva's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/5.0.24/5/9.1 CVS
View user's profileVisit poster's website
alva
1000+ Posts Club

Offline Offline
Joined: May 31, 2005
Posts: 1150
Location: The Netherlands

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?)


alva's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/5.0.24/5/9.1 CVS
View user's profileVisit poster's website
Dizfunkshunal
Platinum Supporter

Offline Offline
Joined: Mar 23, 2006
Posts: 2179
Location: Some where over the rainbow

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

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
View user's profileSend e-mailVisit poster's websiteYahoo Messenger
alva
1000+ Posts Club

Offline Offline
Joined: May 31, 2005
Posts: 1150
Location: The Netherlands

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.

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.


alva's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/5.0.24/5/9.1 CVS
View user's profileVisit poster's website
Dizfunkshunal
Platinum Supporter

Offline Offline
Joined: Mar 23, 2006
Posts: 2179
Location: Some where over the rainbow

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.

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
View user's profileSend e-mailVisit poster's websiteYahoo Messenger
Gerald
Supporter

Offline Offline
Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

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.

_________________
Gerald Scott
Asheville, NC US

Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
View user's profileVisit poster's websitePhoto Gallery
Gerald
Supporter

Offline Offline
Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

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!

_________________
Gerald Scott
Asheville, NC US

Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
View user's profileVisit poster's websitePhoto Gallery
Gerald
Supporter

Offline Offline
Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

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?


Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
View user's profileVisit poster's websitePhoto Gallery
Dizfunkshunal
Platinum Supporter

Offline Offline
Joined: Mar 23, 2006
Posts: 2179
Location: Some where over the rainbow

what is your goal in doing all this? to create a new site but retain all user accounts?

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
View user's profileSend e-mailVisit poster's websiteYahoo Messenger
Display posts from previous:
All times are UTC
Go to page 1, 2 Next

User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español