Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I restore data from a backup? 
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

I’m in the process of moving from 1&1 to SimpleHelix.  I have 3 types of database exports:

1) A backup file straight from Magento’s Admin (.sql and .gz)

2) A full database export from 1&1’s phpMyAdmin (.sql and .gz)

3) A backup of just my Magento database from 1&1’s phpMyAdmin (.sql and .gz)

SimpleHelix has already installed Magento into my account and I just need to restore my product database from 1&1.  ONE HICCUP could be my 1&1 Magento install was 0.7.14800 and the SimpleHelix install is 0.7.15480.

Should I go into my SimpleHelix phpMyAdmin and go to the Import feature and import the Magento Admin backup?

Thanks!

Brady

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Restore your backup on clean database, make sure the cache is clean (var/cache) and refresh any Magento page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

This is how I’m doing it:

phpMyAdmin > Import
Select magento.sql database exported from Magento Admin
When I click ok, I receive the following:

Error

SQL query
:

DROP TABLE IF EXISTS 'admin_assert';

MySQL saidDocumentation
#1064 - 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 ''admin_assert'' at line 1
 
Magento Community Magento Community
Magento Community
Magento Community
 
SeL_
Magento Team
 
Avatar
Total Posts:  1140
Joined:  2007-10-10
Paris, France
 

It looks like your SQL file has problems with backquotes (i’m not sure of the name).
I’m talking about the following character: `
In your copy-paste code, it’s a single quote: ‘
It should be a backquote: `
Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
derbbre
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2007-10-14
 

So… the .sql files produced by magento cannot be read by MySQL?
What should the backticks be replaced with for MySQL to like these .sql files?
I’m amazed - what good is a backup that can’t be restored?
Also, is there a restore feature built in to Magento? I only see “Create Backup”, not “Restore backup"…

?????

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hail Magento
Jr. Member
 
Total Posts:  5
Joined:  2008-01-15
 

I had similar problem with the previous preview version 0.7.15*, looked into the sql & found out the problem with the quote symbol, posted the possible fix in forum as well as bug-tracker. Please look in the suggested code in the post over here:

http://www.magentocommerce.com/boards/viewthread/2601/

please remember it’s for 0.7.15*, so check out if it works with new version coz i haven’t checked the newer version lately.

hope it helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
derbbre
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2007-10-14
 

Thanks - this code desn;t seem to change the output. In fact, I can’t for the life of me figure out where the code is that produces the SQL output. I’ve grepped the entire directory for ‘DROP TABLE IF EXISTS’ and changed the file you mentioned (the only one that shows up) yet my .sql downloads look exactly the same.

Very frustrating.

Thanks again for your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hail Magento
Jr. Member
 
Total Posts:  5
Joined:  2008-01-15
 

it did on my side. Anyway i have just a few more thoughts to add…

* the code i replaced is in fact the one that’ll only change the quote symbol to back-quote.

* did u regenerated the backup or downloaded existing backup file?
...regenerate i suggest and then extract locally. check if the quotes change.

* i feel the people looking after the bug-tracking should have responded by now
... no word yet. They must be busy fixing the nasty ones than this one liner. That’s the right approach i think.

* Try one thing put the file in some good text-editor & do the replacement manually (not hard if it supports replace-all) then give it another shot
... thats how i checked out before looking under the bonnet.

hope it works out this time, else let me know so that i have another go in helping u out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
derbbre
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2007-10-14
 

Thanks for the extended help.
Not sure what you mean by regenerate, maybe re-run the backup? If so, I can’t - the data is hosed, that’s why I need the .sql file. I’ve got the backup files in the var/backups dir, but they’re a binary file…
So - I’ve been clicking the ‘sql’ linkon the backups page on the admin UI, but it’s been handing me the same file.

I awk’ed a search/replace for the DROP TABLE lines and it worked fine. I saw your bug post. Maybe they ignore bugs from older versions? I expect Varien’s planning to put a restore tool in along with the backups. (I’m gonna schedule a regular old MySQL backup job from now on, anyway.)

Anyway—thanks again, I’ve got it going now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PCGamesPlus
Sr. Member
 
Avatar
Total Posts:  166
Joined:  2008-01-03
Sacramento, CA
 

I was having the same problem. Your fix worked for me. Much Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

ok so i attempted this fix and was able to import my backup data successfully, but i now get a 404 error when i try to view either the front end or back end. what did i do wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

even weirder, when i try to go to the domain that magento is installed under, i get a 403 error, which makes me wonder if i hosed something really bad.

 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

any ideas? anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tom Gee
Jr. Member
 
Total Posts:  3
Joined:  2008-07-28
Ontario, Canada
 

Did you ever get your problem fixed?

This thread was very helpful for me.  I restored from the sql.gz backup made by Magento (1.1.2), and had an error come up from Magento about a foreach statement that chould not be executed.

I followed Moshe’s advice, cleared out the cache, and everything came back just dandy!

I hope your problem was also resolved!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top