Page 1 of 1
New install, but using old sqlite db, doesn't work
Posted: Sat Feb 11, 2012 12:17 am
by twoblink
My .htaccess was badly hacked, and so I had to reinstall; I am using sqlite db and so I still have the sqlite db file. So I thought with the new install; I would be able to just copy over the old db, and then put that in as the db to be used, and everything would automatically work.. instead, when I do that, I can't log in, nor does the blog come up. All it says is:
Powered by s9y – Template by Bulletproof development team.
What do i need to do, if I have a copy of the old sqlite db, to make it work with a fresh install?
Any help appreciated.
Thanks in advance.
Albert
Re: New install, but using old sqlite db, doesn't work
Posted: Sat Feb 11, 2012 11:22 pm
by garvinhicking
Hi!
Ypu need to edit your serendipity_config_local.inc.php file and point $serendipity['dbName'] to the name of the old serendipity .db sqlite file instead of the freshly installed one?
HTH,
Garvin
Re: New install, but using old sqlite db, doesn't work
Posted: Mon Feb 13, 2012 10:15 pm
by twoblink
I did do that; but it still won't read it.. is there a reason why? I figure that's all I had to do, but it didn't work out that way.. Any other suggestions??
Re: New install, but using old sqlite db, doesn't work
Posted: Tue Feb 14, 2012 5:04 pm
by garvinhicking
twoblink wrote:I did do that; but it still won't read it.. is there a reason why? I figure that's all I had to do, but it didn't work out that way.. Any other suggestions??
Are you sure editing the file worked properly? Usually the config_local.inc.php has speific write privileges; check if the tool you used to edit the file saved it.
the only place where s9y draws the dbName from is from that file, so this is the single point you should need to change if you want to point s9y to a different SQLite file.
HTH,
GArvin
Re: New install, but using old sqlite db, doesn't work
Posted: Wed Feb 15, 2012 5:55 am
by twoblink
So I opened the old db locally; and it gave me an error; it seems that my old db was sqlite, not sqlite3..???
Was it because I was running a fairly old version of s9y?? I tried exporting all the data via sqldump and then importing it into the new database; no dice. Any other suggestions??
Re: New install, but using old sqlite db, doesn't work
Posted: Wed Feb 15, 2012 10:09 am
by garvinhicking
Hi!
Phew. Usually, SQLite should be backwards compatible, so an SQLite3 PHP module should be able to read SQLite2 tables.
It seems your new host might not have that backward compatibility enabled (even though I have little knowledge of this scenarios). This document:
http://www.sqlite.org/version3.html describes how to migrate from an older version; did you try exactly that? What did happen in the process?
Regards,
Garvin
Re: New install, but using old sqlite db, doesn't work
Posted: Wed Feb 15, 2012 9:50 pm
by twoblink
Did a
sqlite my.db .dump > mydb.sql
sqlite3 mynew.db < mydb.sql
It loaded into the db just fine; pointed serendipity_config_local to the new db.. still no dice

Re: New install, but using old sqlite db, doesn't work
Posted: Wed Feb 15, 2012 10:30 pm
by twoblink
I got it to work! So I found myself in a catch 22; the new install was actually in a different path than the old install; and so when I reverted back to the old DB, the path was incorrect, so it couldn't find it.. and so I used the admin screen to muck with the path FIRST; then changed the local config file; to point it to the correct one.. and that took care of it. Thanks for the help! Really appreciate it. This was a real nightmare..