Move Site

Permalink
Hi
I was working C5 with xampp localy and now that I intended to move to the server I did what usualy used to do (with other CMS):
- backup the database and restore it at the server
- upload all the files by FTP (after clear and disable cache and disable Pretty Urls)

and now I get the error:

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1146: Table 'sorrisow_sorri.Config' doesn't exist] in EXECUTE("select cfValue from Config where cfKey = 'ENABLE_CACHE'") ' in /home/sorrisow/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /home/sorrisow/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(1042): adodb_throw('mysql', 'EXECUTE', 1146, 'Table 'sorrisow...', 'select cfValue ...', false, Object(ADODB_mysql)) #1 /home/sorrisow/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(998): ADOConnection->_Execute('select cfValue ...') #2 /home/sorrisow/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(1610): ADOConnection->Execute('select cfValue ...', Array) #3 /home/sorrisow/public_html/concrete/libraries/database.php(73): ADOConnection->GetRow('select cfValue ...', Array) #4 [internal function]: Database->__call(Array, Array) #5 /home/sorrisow/public_html/concrete/models/config.php(68): Database->GetRow('GetRow', Array) in /home/sorrisow/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78

What can be wrong?

Best Regards
Jose

jgomes
 
orisinal replied on at Permalink Reply
orisinal
How did you exactly import the backup to new server? Did you remember to make changes to database settings in config/site.php?

If your new database is really in use, I think that the backup isn't imported properly. Take a look at new db directly with phpmyadmin or mysql cli. Can you see any tables there?
jgomes replied on at Permalink Reply
jgomes
Did made a backup - changed the database name to the new database in the text file generated - and dumped all with phpmyadmin to the server (100 tables where generated).
Then did change config/site.php.
And yes I can see the tables there...
Mnkras replied on at Permalink Reply
Mnkras
did you move from windows to linux or vise versa?
jgomes replied on at Permalink Reply
jgomes
yes!
I was working on windows (xampp) and moved to a linux server! Is there the problem?
elyon replied on at Permalink Reply
elyon
Yeah, MySQL in Windows handles casing differently than Linux. You might have to go through and rename the tables by hand.

Then, in the future, you can set lower_case_table_names=2 on Windows to help smooth the transition from your computer to your server.
jgomes replied on at Permalink Reply
jgomes
Hi

I did try to set lower_case_table_names=2 in windows but the variables have permissions to read only - How may I turn permissions to be able to set lower_case_table_names=2?

Help Please

Regards
Jose
axelhahn replied on at Permalink Reply
axelhahn
How did you try to change it?
Put

lower_case_table_names=2

to my.ini in the mysql dir and restart mysql service.
orisinal replied on at Permalink Reply
orisinal
Have you double checked that the database name is "sorrisow_sorri" and there is that "Config" table, case sensitive? I can't see any other problem here, as ADOdb wouldn't give that error message if it wasn't connected to the database or you had no permissions for it.

What Mnkras probably meant, Linux has case sensitive table names and table names are stored as written. Windows instead uses lowercase table names by default, so it converts everything to lowercase.

If this is the case and there is no other option, you can try this system variable in MySQL:

lower_case_table_names=1

BEFORE you do that, make sure there are no other databases with uppercase table names! Remember to restart MySQL.
jgomes replied on at Permalink Reply
jgomes
Ok people.

Thanx for your help. This was my first moving and it was not the Site Ready To Work - it was a test...
So as Elyon says I will "prepare" the tables on Windows to help with the transition.

Thank You

Jose
axelhahn replied on at Permalink Best Answer Reply 1 Attachment
axelhahn
I just have the same problem and need to do the same. I developed my page in WAMP and try to transfer to a hoster with Linux.
Here is a script to rename the default C5 tables:
- backup your db on windows mysql (just to be sure).
- Execute sql in this attachment on your windows mysql server.
- dump db again and import in linux mysql
For me it worked.

Axel
orisinal replied on at Permalink Reply
orisinal
Hmm.. Bit strange SQL file, as it renames AreaGroupBlockTypes to AreaGroupBlockTypesTMP and back to AreaGroupBlockTypes, but I think I know the reason for it. It just feels stupid if it doesn't rename tables just by using...

ALTER TABLE `areagroupblocktypes` RENAME `AreaGroupBlockTypes`

...having lower_case_table_names=2, of course. Maybe it complains "Get glasses! There is already table named AreaGroupBlockTypes", as all the lookups are converted to lowercase, but renames are not.
jgomes replied on at Permalink Reply
jgomes
Sorry my ignorance but how shell I turn variables permissions to write?
axelhahn replied on at Permalink Reply
axelhahn
with "ALTER TABLE `areagroupblocktypes` RENAME `AreaGroupBlockTypes`" i got the error message from mysql server "table already exists". Thats why i used the step with TMP.
admin replied on at Permalink Reply
Thanks axelhahn

It didn't quite work for me on windows (also moving a wamp site) - but i changed all the initial table names in your file to lowercase and ran it on the server instead - worked.
If you do it that way one can of course skip the TMP table step.

How can I assure however that it my tables on localhost will be compatible.

Must my.ini be:

lower_case_table_names=1 or 2 ?

Thanks in advance

Dyrk
grosbedo replied on at Permalink Reply
Worked like a charm, but needs some updating for the latest version of C5.

Here is the updated sql script for Concrete5 v5.4.0.5 plus asmiller_gallery and crossslide.

/EDIT: oops, the case was not respected for one of the tables. I updated this post, you can find the fixed sql script attached.
grosbedo replied on at Permalink Reply 1 Attachment
Here is the fixed sql script (seems that one can't update a file by editing a post).
mixedpixel replied on at Permalink Reply
mixedpixel
Hello. We wrote add-on to fix this problem. It's renames core tables and packages for individual installations. Should works great for you. Check it:

http://www.concrete5.org/marketplace/addons/mysql-case-insensitive-...

See how it works:
http://www.concrete5.org/files/1112/9040/0018/MySQLCaseInsensitiveH...

Best regards
mixedpixel
intrax replied on at Permalink Reply
This is SO BASIC it should be FREE and included with concrete5 i.o some 'abzocker' charging 30 bucks for this ! These kind of things really put me OFF concrete%... bad job Fritzl !
12345j replied on at Permalink Reply
12345j
looks like there is a script like this above, which you can use for free- but otherwise $30 isn't bad. Think how long it would take you to write it, if you even know php and sql well.
intrax replied on at Permalink Reply
Probably will write a script myself and post it for free to teach them a lesson !
jordanlev replied on at Permalink Reply
jordanlev
It only takes a few minutes if you have good text editing tools:
http://www.concrete5.org/community/forums/installation/table-names-...

I am a bit disappointed that someone is charging for this, although I could see how if you don't know how to get into phpmyadmin it might make sense (or better yet if it will automatically update when new C5 comes out -- or better better yet if it works for ALL tables and not just the C5 core ones, i.e. other blocks/packages you have installed).
mixedpixel replied on at Permalink Reply
mixedpixel
Intrax don't be so nervous. Of course You can always fix tables names manually. We create this add-on for people who doesn't have much time and they want to do this automatically. For sure - it's not a C5 dev problem but mysql and OS filesystem. I can give you a free license to prove you that this add-on is worth that money. And probably you don't need this add-on so what's your problem? :) Best Regards.
jordanlev replied on at Permalink Reply
jordanlev
I think the problem is that there is a *perception* among many people that core fixes and developer tools should be free. I am not saying that this is right or wrong, but that most people seem to expect this.

I don't think anyone has a problem with someone selling a premium theme, and most people probably don't have a problem with someone selling an advanced image gallery or an ecommerce package (for example). But when it comes to very foundational tools like this that are essential to just making a basic site work, then it rubs people the wrong way to have to pay money for it (because really it should be fixed in the core system).

Again, I am *not* arguing that this is right or wrong, but I think it is important for us marketplace developers to understand the reality that people have certain perceptions, and if you are going against a common perception like this, then it is to your benefit to do a very good job of explaining *why* the thing you are selling is worth the money.

Since there are free scripts floating around the forums to address this issue, what is it that your paid addon does that is better than the free scripts?

-Jordan
intrax replied on at Permalink Reply 1 Attachment
I'm not nervous. Just telling you it's a bloody schame to charge people for something that should have been solved in concrete5 long time ago and is necessary to move a site from dev local-pc to a linux/unix host. As concrete5 is now OpenSource all basic functionality should be FREE i.m.o. Anyway I post the script I used to solve this problem here, it has been posted allready somewhere else on this site, I just checked all tablenames again for v5.4.1.1... It's FREE ! Run the script locally than login to phpadmin on your server and run the resulting sql script. It should rename all tables to mixedcase on your host server. Goodluck !
llkojnjhfy replied on at Permalink Reply
What Mnkras probably meant, Linux has case sensitive table names and table names are stored as written. Windows instead uses lowercase table names by default, so it converts everything to lowercase.[URL=http://www.designerbagssell.com]designer handbags for less[/URL]
Mnkras replied on at Permalink Reply
Mnkras
Correct :)

(also the only bbcode on the forums is [code])
intrax replied on at Permalink Reply
@llkojnjhfy- it was a reply to mixedpixel's reply as you probably didn't read the whole thread..
jordanlev replied on at Permalink Reply
jordanlev
Hey guys, that's a spammer/spambot -- no need to keep helping him/her/it :)
intrax replied on at Permalink Reply
Looks like you are a big idiot not to be yaken seriously...