Please, How to import backed up database into fresh install? Or pull info out of SQL file...? I deleted my (client's) database on accident...Help

Permalink
Hello,

Thanks for looking at my thread.

I'm getting a message "Unable to connect to database. A database error occurred while processing this request."

I believe the reason this is happening is because I originally built this site on a subdomain - testsite1.mydomain.com - and then when I finished, all I did was copy all the files over to therealdomain.com.

But -- and I think this is what caused this problem -- I uninstalled Concrete5 off the old subdomain that I originally built the site on, and then I installed a new copy of concrete5 onto that same subdomain.

I'm using a hosting company. And I have a support ticket from them to restore the database. Will that fix it? I have no idea if they just create a new database with the old name if that will work or what.

I don't have any experience with MySQL at all. I have no idea what was stored in the database, or what I can salvage from just the files in CPanel.

Thanks so much,

-- Brian

Update: Okay, I can't figure out how to import the old SQL Database into the new site.

I reinstalled concrete 5, and have a clean install. Then I went to the SQL database in PHPMyAdmin, and tried to import the old database directly into that, got an error, had to "drop" all the current tables, and then successfully imported the old database, but nothing happened - still looks like a fresh install. (I also tried copying the old files and then using the same name as the old database, often getting "unable to connect to database error".)

Is there anything I can do besides manually copy and past the text out of the database? And re-upload all the pictures?

T_T

Thanks. I'm frustrated right now (with myself obviously & my absentmindedness), but still <3 C5.

 
tallacman replied on at Permalink Reply
tallacman
Is your build site still intact? Do you have all the files and the database? It is usually pretty easy to move a site. I could have a look for you.
8Brian replied on at Permalink Reply
Hey, thank you so much for your offer to help.

My webhost had a backup of the database that was deleted when I uninstalled concrete unknowingly from the site (it was labeled as the subdomain, like I said... stupid of me, I should have backed it up). The files were all left intact though, since the "uninstall" was not technically for that domain. It's just that the database (and possibly other C5 pieces) were on that older domain, that I originally built the site on. When I removed C5 from the subdomain, it deleted the database.

I have the .sql file, file though.

I've also sent you a PM with some other details.

So, what I just did was I went into CPanel, and through the file manager, copied all the original site files from public_html/mysite.com to /mysite.com2 (note the 2), since those were all still there. My hosting company restored the old database (_conc644) (that database isn't showing up in CPanel > My Databases > MySQL Databases after my webhost co restored it, but it shows up in PHPMyAdmin which you can get to from CPanel). So, from CPanel > Software/Services > Softaculous, I installed a fresh copy of Concrete5 onto the mysite.com domain, and chose the database name "affor" (to make it unique so I know which is which).

Then I went into PHPMyAdmin, I exported the _conc644 database to my computer (this is the original database, verified as such because it has the website's content). I then, through PHPMyAdmin, tried to import the conc644.sql file into the affor database. To do this, though, I first had to "drop" all the tables, because PHPMyAdmin wouldn't let me overwrite the existing data. So I successfully did that.

And that's all I've done (which doesn't work...). This is the first time I've used PHPMyAdmin, and the first time I've ever looked at a .sql file.
8Brian replied on at Permalink Reply
Update:

I was able to restore the database. But the pictures are gone, and the text for all the headers is fuzzy. I'll tell you how I restored the database and got the site functioning.

1) I installed a fresh Concrete5 install onto the domain, naming the database "affor".
2) I put in the theme using the file manager. You also need to copy the old "/domain/packages" contents into the new install or else you get "file [in the packages folder] does not exist" errors when trying to add any blocks.
3) I went into PHPMyAdmin, selected the _affor database on the left panel, then on the right panel where all the tables come up, I scrolled all the way down and selected "check all," and from "with selected" chose EMPTY (not drop).
4) Then in the top menu , I chose "import," and imported the old database .sql file.

Addition:
5) Copy over the contents of the domain/files folder to get the pictures to work, and the domain/thumbnails folder so the thumbnails to show up in the picture blocks in edit mode.
Adreco replied on at Permalink Reply
Adreco
Hey Brian,
Do you still have access to your - "old/domain/file" content? I believe your images could be stored there in numbered sub-folders

Adrian
8Brian replied on at Permalink Reply
Yes, I do.

I'm about to go through rebuilding the site. I have the theme, the content (now that I restored the database successfully, though the site's not satisfactory), and I've been able to find the pictures through the file manager's search.

===

Actually, I instead copied the contents of the domain/files folder over to the new install, and all the pictures worked with the exception of one on the home page. I don't know why that one wasn't working but I just reselected the file and it worked.

So the only thing that's still wrong is that some of the heading text is pretty fuzzy. I have no idea what's going on with that - it looks like it's overlapped for some reason; or shadowed, actually; the letters that look behind the letters are a slightly different color.

Also the picture on the homepage I mentioned before is really poor quality now. Actually on closer inspection all the pictures are much worse quality than they were.