News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Moving CREATE DROP Table statements to new database

Started by Katieblack, January 14, 2010, 12:23:48 PM

Previous topic - Next topic

Katieblack

Long story short, I totally messed up my forum to the point where my server host is importing a backup sql database for me.

Everything went down on January 10th, but I wisely (so I thought) made a backup of my database.  However, including the table data in that database is an option that is un-checked by default in my admin panel.  I didn't understand what it was for, so I usually don't do it.

The last time I made a back-up that included the CREATE DROP table statements was December 26th. 

I have to get this forum back up and running, but I hate the thought of losing almost 3 weeks of posts and members etc.  I even promoted a few people to moderators in that time period.

So, is it possible to take the CREATE and DROP table statements from my 12-26 sql and paste them into my 10-10 sql? 

Would I be able to upload it then and not lose anything?

Thanks so much for your help!

MrPhil

You could cut and paste the DROP and CREATE (in that order) commands into your .sql file. There's nothing magical about that file. It's just a list of SQL commands to run.

If you're not changing SMF versions during the process, and all your old tables still exist, you could just use phpMyAdmin to EMPTY (not DROP) the tables. I'm guessing that your most recent backup just has the INSERT commands. If you think you messed up the structure of your tables somewhere along the line, you will want to DROP and reCREATE them anew just to be safe.

Advertisement: