Restoring database on new install.

Permalink
Hi, firstly let me say I don't really know what I'm doing! ;-)
I've gotten this far with lots of googling and general fiddling...

So, recently my sites were hacked. Most of the php files had been tampered with so I decided it would be best if I installed C5 afresh.
I renamed the old directory as a backup and installed C5 into a fresh one.
In order to install I had to 'drop' my sql tables (having backed up the db) and then when C5 was working I restored the database.
However when going to my site I just get a blank 'C5' website (I didn't install the demo stuff). Trying to log in prints up the following:-

"mysql error: [1054: Unknown column 'uDefaultLanguage' in 'field list'] in EXECUTE("select uID, uName, uIsActive, uIsValidated, uTimezone, uDefaultLanguage from Users where uName = '*******' and uPassword = '*******************'")"
(NB: I edited in the *'s)

Is it possible my database is for an older (or newer) version of C5? (I'm installing 5.4.2.2) if so can I find out what version to install from the tables in the database?
Some of my sites also use add-ons from the marketplace - do these need installing first? Or will the site 'work' without?

Any help gratefully received. Many thanks.
Steve.

 
JohntheFish replied on at Permalink Reply
JohntheFish
A couple of possibilities/things to check (not an answer, just some ideas):

- Are you missing some addons or themes that the restored database expects to see?

- Were there any custom settings in config/site or other config?
kwackers replied on at Permalink Reply
I'm just using the default theme. There were some plug-ins - although I'm not sure they'd be on the title page and there was no attempt to render it.

I'd like to start by figuring out what version of C5 I had installed - can I tell that from the database? Or possibly one of the old files?
If I install that version then it's one less thing to worry about.

After that I need to figure out what plug-ins I was using - again is there anyway to find that information out from the database or the old files? If not then it could be a big job since I'm not entirely show which sites used which plug-ins...

Thanks for your reply.
Cheers,
Steve.
kwackers replied on at Permalink Reply
Ah, just found the version number in the database.

It's under 'config' - there are two values in there:-
SITE_APP_VERSION
&
APP_VERSION_LATEST

Not sure what the difference is though - should I install SITE_APP or APP_VERSION.
APP_VERSION is slightly later so I guess it makes sense to install that??
jedininja replied on at Permalink Reply
jedininja
Any other luck on your problem. A client site of mine is having the same problem/error:

mysql error: [1054: Unknown column 'uDefaultLanguage' in 'field list'] in EXECUTE("select uID, uName, uIsActive, uIsValidated, uTimezone, uDefaultLanguage from Users where uName = 'admin' and uPassword = '35244d31a6826759511395765b89fc23'")

I've just begun searching for a solution, I'll try to keep you posted too.
kwackers replied on at Permalink Reply
Partial luck - although I've not had time time to go back to it.

The error seems to simply be the version - I installed the version listed in SITE_APP_VERSION (the later version isn't listed on C5's download area) and then restored my DB.
This fixed the issue and the title page layout looked correct.

The next thing was all the graphics were missing - this turned out to be a simple case of restoring the 'files' directory from the old version.

However the site layout (i.e. all the pages and their relationships) is still missing. I guess that's stored elsewhere but haven't figured it out yet.
If anyone knows...
jedininja replied on at Permalink Reply 1 Attachment
jedininja
Not sure if this will help you.

So far I've been able to sign in as my admin (user table only shows my admin user, but there really should be another user somewhere, not sure about whats going on there yet).
But No more error!

Go to your database and the Users table. Notice what the error was saying..

Unknown column 'uDefaultLanguage' in 'field list'
Its saying uDefaultLanguage is unknown.. can't find it. Field list.. idk what the really means.

in EXECUTE("select uID, uName, uIsActive, uIsValidated, uTimezone, uDefaultLanguage from Users where uName .. from Users)
Users is the table

the EXECUTE is the query (like a script), its trying to find everything mentioned. Select the userID, userName..

I tried running the query without uDefaultLanuage, but got another error. So instead I added it to the Users table.

query this while in your Users table:
ALTER TABLE Users ADD Column uDefaultLanguage VARCHAR(128) ;

I added a screen shot for you too.
Now I need to figure out if my other login is there and works.
Let me know if you need any help.
jedininja replied on at Permalink Reply
jedininja
Yeah, the other user was gone. I recreated it and no 1054 errors. All good for now.