Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
Who's Online
2 Registered (Gizmo, Rascal), 16 Guests and 19 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
Gizmo 11706
Rick 7567
Ian 4107
Mark S 3983
ntdoc 3114
Sirdude 2041
jgeoff 1882
David Dreezer 1759
driv 1569
AllenAyres 1530
Latest Photos
Carrie - So Very
Testing
Test Photo
4TH of July at the river!
Test shots from D300 part 3
Topic Options
Rate This Topic
#213180 - 05/21/08 01:07 PM How to purge database before restoring a backup?
doug Offline
member

Registered: 01/24/07
Posts: 115
I am not well versed in php and mysql and am finding Gizmo's tutorials invaluable. Thank you Gizmo!

I am in the process of moving to a new VPS and in doing so I have made a trial run at moving my database using Gizmo's command line instructions. So now I have an old version of my database sitting on the new server.

In Gizmo's tutorial on backing up, he mentions that "And to restore said backup, after you purge data out of the MySQL database:" - which I believe would mean that I now have to purge that old database version before I can install the current database.

How do I do that? Any suggestions? All help is appreciated!

Top
#213185 - 05/21/08 01:38 PM Re: How to purge database before restoring a backup? [Re: doug]
doug Offline
member

Registered: 01/24/07
Posts: 115
Hmmm... I tried selecting all of the tables in phpmyadmin and clicked "empty". I guess that works...

Top
#213188 - 05/21/08 01:53 PM Re: How to purge database before restoring a backup? [Re: doug]
blaaskaak Offline


Registered: 08/30/06
Posts: 1218
Loc: Breda, NL
I usually copy the list of tables to a textfile, and do a search replace to end up with a large list of DROP TABLE statements.
_________________________

Top
#213191 - 05/21/08 02:02 PM Re: How to purge database before restoring a backup? [Re: blaaskaak]
Sirdude Offline


Registered: 04/19/07
Posts: 2041
Loc: SoCal, USA
hehe, i simply create a new DB with no tables and then import.. the mysqldump has the create tables and the mysql import specifies which DB you are importing to..

bada bing *poof*
_________________________

A taxpayer voting for Obama is like a chicken voting for Colonel Sanders.

Top
#213192 - 05/21/08 02:11 PM Re: How to purge database before restoring a backup? [Re: Sirdude]
doug Offline
member

Registered: 01/24/07
Posts: 115
Yeah, I thought of that but I had a bad experience with that in the past. I am using Cpanel and using their mysql management tool - in the past when I deleted a BD and then tried to create a new on with the same name - the program would not let me. I would have to create a new DB with a different name frown

Top
#213193 - 05/21/08 02:17 PM Re: How to purge database before restoring a backup? [Re: doug]
Sirdude Offline


Registered: 04/19/07
Posts: 2041
Loc: SoCal, USA
no probs then.. what you did is fine.. you essentially dropped all the tables..

so you are at the point where you can create the tables smile
_________________________

A taxpayer voting for Obama is like a chicken voting for Colonel Sanders.

Top
#213194 - 05/21/08 02:25 PM Re: How to purge database before restoring a backup? [Re: Sirdude]
doug Offline
member

Registered: 01/24/07
Posts: 115
Thank you smile

Top
#213200 - 05/21/08 06:15 PM Re: How to purge database before restoring a backup? [Re: doug]
Gizmo Moderator Online   shocked


Registered: 06/04/06
Posts: 11706
Loc: Portland, OR; USA
Use PHPMyAdmin and click "drop tables" on the table select screen; that's how I do it wink...
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#213204 - 05/21/08 07:05 PM Re: How to purge database before restoring a backup? [Re: Gizmo]
doug Offline
member

Registered: 01/24/07
Posts: 115
Thanks Gizmo, I will do that.

Top
#213214 - 05/22/08 01:25 AM Re: How to purge database before restoring a backup? [Re: Gizmo]
blaaskaak Offline


Registered: 08/30/06
Posts: 1218
Loc: Breda, NL
Originally Posted By: Gizmo
Use PHPMyAdmin and click "drop tables" on the table select screen; that's how I do it wink...


Duh, how simple laugh

Fun how you can look over things for years laugh
_________________________

Top


Moderator:  Gizmo 
Shout Box

Recent Topics
[7.3.x] Ignore link showed in userprofile for global moderators
by blaaskaak
Today at 01:27 PM
[7.3.x] Database password shown in adminlogs...
by blaaskaak
Today at 10:24 AM
7.3.1 Flood protection
by MattUK
Today at 03:55 AM
Changing title of forum
by Baby Boomer
Yesterday at 07:38 AM
Disable PM's for one group
by Musky
Yesterday at 07:10 AM
Forum Stats
4026 Members
33 Forums
30883 Topics
156825 Posts

Max Online: 978 @ 06/24/07 08:19 PM