Zen Cart Logo
Forums / General Questions / I just royally screwed myself, SQL Please Help

I just royally screwed myself, SQL Please Help

Views: 934

Results 1 to 13 of 13
18 Mar 2015, 4:11 AM
#1
jwlamb avatar

jwlamb

Zen Follower

Join Date:
Jan 2014
Location:
Arizona
Posts:
110
Plugin Contributions:
0

I just royally screwed myself, SQL Please Help

Is there anyway of undoing an SQL that I just ran?

I was having issues with a plugin and I tried to run an SQL patch without knowing what I am doing (first clue). When I tried to edit or delete a customer I was getting a HTML 500 error. So I tried to just "reset" my store :no: by running mysql_zencart.sql, which just deleted my whole store, products, customers, orders, etc, etc. :shocking:

PLEASE, is there anyway of fixing this?????

18 Mar 2015, 4:56 AM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: I just royally screwed myself, SQL Please Help

Yes, using the .sql backup you made/exported in phpMYadmin (or similar SQL program) BEFORE you attempted installing any upgrades to your site - just import the backup and your database will be back to normal. Site files the same, republish the site files you backed up prior to the updates.

18 Mar 2015, 5:25 AM
#3
jwlamb avatar

jwlamb

Zen Follower

Join Date:
Jan 2014
Location:
Arizona
Posts:
110
Plugin Contributions:
0

Re: I just royally screwed myself, SQL Please Help

Hi Twitch,

Ummm, I don't have an SQL program... Is that the ONLY way?

18 Mar 2015, 8:13 AM
#4
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: I just royally screwed myself, SQL Please Help

jwlamb:

Hi Twitch,

Ummm, I don't have an SQL program... Is that the ONLY way?

If don't have a recent backup of your database then the headline of this thread rings absolutely true - sorry. If that is the case then contact your host and ask if they are doing daily backups - if yes ask them to restore the lot.

A good host does daily backups......

18 Mar 2015, 12:50 PM
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: I just royally screwed myself, SQL Please Help

jwlamb:

Is there anyway of undoing an SQL that I just ran?Nope.. If you have a backup of the store BEFORE you ran the SQL script you could restore from your backup..

18 Mar 2015, 2:20 PM
#6
enigma777 avatar

enigma777

New Zenner

Join Date:
Oct 2006
Posts:
55
Plugin Contributions:
0

Re: I just royally screwed myself, SQL Please Help

Talk to your webhost. Maybe they can provide you with a backup. Most decent host perform regular daily backups.

Good luck.

18 Mar 2015, 7:24 PM
#7
jwlamb avatar

jwlamb

Zen Follower

Join Date:
Jan 2014
Location:
Arizona
Posts:
110
Plugin Contributions:
0

Re: I just royally screwed myself, SQL Please Help

Thank you to everyone who suggested going to my hosting provider, which is GoDaddy BTW. They do not do daily backups, but they did have a backup from two days ago, so I only lost data for one customer and one order. Luckily I had the needed info in my email, so I was able to recover from this mess.

If anyone else finds themselves in the same situation with GoDaddy, they charge $150 for "emergency backups". Luckily I was able to get them to waive the fee for my first time screw-up. Now I know there is more to backing up your store than just the files on the ftp. Lessons learned the hard way are remembered the most.

18 Mar 2015, 9:09 PM
#8
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: I just royally screwed myself, SQL Please Help

jwlamb:

......my hosting provider, which is GoDaddy BTW. They do not do daily backups......

That in itself would prevent me from hosting with GD - pay cheap get cheap.

In addition to my host making daily backups, I also run a cron tab on all of my sites which backs up DB's daily to a folder outside the ZC environment. Another cron tab deletes any backups older than 14 or 30 days which keeps space usage to a limit.

Better safe than sorry.....

18 Mar 2015, 10:18 PM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: I just royally screwed myself, SQL Please Help

jwlamb:

Thank you to everyone who suggested going to my hosting provider, which is GoDaddy BTW. They do not do daily backups, but they did have a backup from two days ago, so I only lost data for one customer and one order. Luckily I had the needed info in my email, so I was able to recover from this mess.

If anyone else finds themselves in the same situation with GoDaddy, they charge $150 for "emergency backups". Luckily I was able to get them to waive the fee for my first time screw-up. Now I know there is more to backing up your store than just the files on the ftp. Lessons learned the hard way are remembered the most.
The bigger lesson is that you need to backup your whole store before installing anything so that you can rollback if you need to.. Even better is that you should have a development version of your site which is a "clone" of the live site so you can test before making changes to your live store..

18 Mar 2015, 10:23 PM
#10
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: I just royally screwed myself, SQL Please Help

DivaVocals:

The bigger lesson is that you need to backup your whole store before installing anything so that you can rollback if you need to.. Even better is that you should have a development version of your site which is a "clone" of the live site so you can test before making changes to your live store..

Yep, that should be mandatory!

22 Mar 2015, 4:07 AM
#11
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: I just royally screwed myself, SQL Please Help

In response to your PM (questions should be posted in the forums unless they are of a commercial nature):

jwlamb:

How does one go about making a clone site? I've tried to create a separate folder .com/shop/ and .com/test/ and it doesn't seem to work. I'm a missing a step?

Thank you,

You create a clone of your live site on your local computer - NOT on the live webserver. If your live server goes down, your cloned site goes down as well if it is installed on that server...

Depending on your OS you need to install LAMP, MAMP, WAMP or XAMPP and install an instance of your live ZC shop.

22 Mar 2015, 6:52 AM
#12
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: I just royally screwed myself, SQL Please Help

frank18:

In response to your PM (questions should be posted in the forums unless they are of a commercial nature):

You create a clone of your live site on your local computer - NOT on the live webserver. If your live server goes down, your cloned site goes down as well if it is installed on that server...

Depending on your OS you need to install LAMP, MAMP, WAMP or XAMPP and install an instance of your live ZC shop.Yes this is a good idea for the reasons you state, but he can also create one on his webhost as well.. It would help if the OP could explain what he means by "it didn't work" since chances are that if he doesn't understand/know how to do this on his webhost, he will have the same issues creating a local clone of his site..

22 Mar 2015, 7:21 AM
#13
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2