Uploading Local Site to Live - SQL database issues

Permalink
Hi, I have built a local site and I am now ready to upload it to the hosting company I am using (Bluehost)

The site works perfectly well on my local machine, but I have a feeling that once I copy all the files etc across via ftp (Filezilla) that the database on the live will not match the the site will not work properly in live.

The database on the live is called orchidpa_cnc1 - it has a different user name and password.

The local database is called orchidpalm and uses the core username (root) and no password.

I have tried to export the local database and import it to the live database (I have also added the username and password from the live database hosts to the local database)

and I keep getting errors telling me the username and password is not correct.!! Please help, I must be missing something somewhere along the line.

garyjhills
 
garyjhills replied on at Permalink Reply
garyjhills
Hi, an update for this now -

I have managed to copy the SQL database contents to the live environment. However, after editing the site.php located in public_html/config to show the correct database name and password, it comes up with a page telling me it was unable to connect to the database.

What am I doing wrong? anyone can help? I think it might be the PASSWORD_SALT line in the site.php file that is causing the issue.

Is there anyway to reset this?
olliephillips replied on at Permalink Reply
olliephillips
It's not the salt - that applies to C5 passwords. It won't be the reason you cannot connect to the database.

You will need the correct database name (on the production server) in your site.php file and you will need to check you are using the correct server. Localhost is fine 9 times out of 10, but some hosts run separate database servers in which case you'd need to specify the hostname or IP address of the server. I don't know about Bluehost.

The only other thing I'd check for is case conversion of the tables between export and import. That can cause issues.

Hope that helps.
centralcec replied on at Permalink Reply
I had a similar issue not long ago. I just moved to a new host. The best way to fix it which isn't the shortest by any means but it seemed to be the most thorough...
Basically, I wiped my production server clean and the MySql database. Created a new database, uploaded C5, did a clean new install and input the database info to connect it then. This meant it was a clean working slate to start with.
I then connected FTP to my blank site, uploaded all of my stuff (/concrete, /files, /packages, etc. or whatever you need).
I then connected to my MySql database, dropped all the tables that the clean site created, and imported the tables and data that I backed up from the previous site (in your case from your local machine).

Like I said, this isn't a short, quick fix but it seemed to be the best end result for me. I went through many steps trying to get everything working just right before and kept having issues so I just went this route...

Hope that helps, good luck.
garyjhills replied on at Permalink Reply
garyjhills
Thanks for replying guys. I had thought already about the long version, so at present I have done the following: -

Wiped the public_html folder clean, wiped the SQL database clean. Installed a new version of Concrete5 to the public_html folder.

then, after doing this, I went to the site which gave me the initial Concrete5 site setup page to enter the server, db name etc etc.

I then copied the site.php file to my local files. I cleaned the db again and then imported all the tables from my local one.

Now I am in the process of uploading all the files for the site from local to public_html which is nearly finished.

Then I'll put the site.php in the right place and....well, we'll see if that works!
garyjhills replied on at Permalink Reply
garyjhills
ok, all uploads done, database tables done as well, seems to connect to the site db now but with fatal errors in the db!

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

Not sure what else to do here, maybe try creating a new db and changing the site.php to connect to the new one?
centralcec replied on at Permalink Reply
I would check the database and make sure the table names all have the correct upper and lowercase letters when comparing the local and production database. Just glancing at this post from my phone I'm thinking that error may be that it can't find a table which an improper name (capitalization matters here) will cause this as well. First off, check to make sure your Config table exists with the "C" at the beginning capitalized and make sure it is the same in the local database.
garyjhills replied on at Permalink Reply
garyjhills
That is the strange thing, it doesn't exist in either of the databases, yet the local one works fine and the pages display correctly when browsing to the local host. I'm really stumped on this one and it's well frustrating.

Both db's have the same entries, with same capitalization and everything looks fine (or at least it does to me)

I appreciate your time in helping trouble shoot this very much, the last thing I want to have to do is make a complete fresh install of C5 on the server and then remake the entire site!!! That would be a real nightmare and waste of all that time I spent making it locally
centralcec replied on at Permalink Reply
What version of C5 is installed locally? What version on the production hosted server?
There should be a Config table in the database. I'm not quite sure why the local copy lets you get away without this and why it wasn't created in the first place...
centralcec replied on at Permalink Reply
The best thing would be to upgrade the local copy of the site to the latest version, 5.4.1.1 (assuming you don't already have this version and you follow the proper steps to upgrade to this version depending on how old it currently is) and make sure everything still works properly. If so, go back, wipe the public_html, wipe the database, install a fresh 5.4.1.1 in public.html, create a new database, connect it with the base site, then upload your files and site stuff, just don't transfer the /config folder (in the root) with the site.php file in it.
centralcec replied on at Permalink Reply
Have you had any luck with this?
garyjhills replied on at Permalink Reply
garyjhills
One thing I forgot to ask - Did you delete all of the data in public_html before uploading all the local data? or did you just do a copy over and replace the ones that were not already there?
garyjhills replied on at Permalink Reply
garyjhills
oh and those were the steps I took.

1. clear the public_html on production
2. clear the original database on production
3. re-install C5 v 5.4.1.1 to production
4. browse tohttp://www.orchidpalmhomes.com
5. setup C5 with the fresh install and server information
This all worked great and I was able to see the site, dashboard etc of a brand new install.

I then did the following: -

1. removed all data from the new db on production
2. uploaded the data to the new db by import from the export of the local db
3. uploaded all of the local files from the folder on my PC
4. tried to open the site and got the SQL error.

In my previous posts, I may be did not explain properly, there is a config folder on both the local and the production. but I am unable to see any EXECUTE table in either.
garyjhills replied on at Permalink Reply
garyjhills
Hi centralcec, sorry it was very late here and went to bed. I have checked, the version on both is exactly the same - 5.4.1.1

I downloaded the latest version before beginning the local build and use the same version when I upload to production.

I am going to try to start a fresh again, maybe I did something a bit wrong before and will retrace my steps again.
garyjhills replied on at Permalink Reply
garyjhills
From the clean slate install that is? I did the clean install, got C5 working, then deleted all of the public_html and copied across all of my local files. Maybe by doing this I deleted something from the table I shouldn't have?
centralcec replied on at Permalink Reply
What I was suggesting doing was very similar to the steps you described.
Clear public_html
Clear database
reinstall C5
browse to site
setup C5 with server info
then
Don't wipe the public_html folder, just upload your local stuff and let it copy over anything that already exists but leave everything else alone.
Wipe the database
Import the database from local
Try to open the site.

As for the Config stuff. There should be a config folder in the root public_html as well as one in public_html/concrete. In addition to these folders, there should be a TABLE in the database named Config. The "schema.sql" file should have created all of this for you when you set everything up (installed C5)...
centralcec replied on at Permalink Reply
Also, when uploading your local data, only upload the local /files, /concrete, and /packages folder at first, along with the index.php file if it has been modified any... Leave all of the rest the way they are. Also, do you have a php5.ini file locally or anything? Have you checked to make sure all of the php settings on the server are the same as locally (like Safe mode, cgi.fix_pathinfo = 1, file size stuff or anything you may have added)?

One last thing. Are you running Windows locally? Are you running on a Windows production host? If not, some of your code you created locally may not work properly on a Linux host because of capitalization, folder paths, etc...
garyjhills replied on at Permalink Reply
garyjhills
Hi centralcec, I thought I had lost this thread so I styarted a new one and got a couple of pretty helpful posts:

http://www.concrete5.org/community/forums/customizing_c5/sql-databa...

Am going through now and reading them to see how to apply the fix to the database.

Check it out.
ankprasanna replied on at Permalink Reply
Hi
I installed C5.4.2 on my local host (using xampp) and designed website. Later, I uploaded entire folder to LIVE Site (parallels plesk panel) along with database and did corrections in site.php in config folder. But when I accessed the site URL I am getting following error message. Kindly help me to solve this issue

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1146: Table 'ipecsr.Config' doesn't exist] in EXECUTE("select cfValue from Config where cfKey = 'ENABLE_CACHE'") ' in D:\inetpub\vhosts\ipeindia.org\subdomains\ccsr\httpdocs\concrete\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php:78 Stack trace: #0 D:\inetpub\vhosts\ipeindia.org\subdomains\ccsr\httpdocs\concrete\concrete\libraries\3rdparty\adodb\adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 1146, 'Table 'ipecsr.C...', 'select cfValue ...', false, Object(ADODB_mysql)) #1 D:\inetpub\vhosts\ipeindia.org\subdomains\ccsr\httpdocs\concrete\concrete\libraries\3rdparty\adodb\adodb.inc.php(993): ADOConnection->_Execute('select cfValue ...') #2 D:\inetpub\vhosts\ipeindia.org\subdomains\ccsr\httpdocs\concrete\concrete\libraries\3rdparty\adodb\adodb.inc.php(1605): ADOConnection->Execute('select cfValue ...', Array) #3 [internal function]: ADOConnection->GetRow('select cfValue ...', Array) #4 D:\inetpub\vhosts\ipeindia.org\subdomains\ccsr\ in D:\inetpub\vhosts\ipeindia.org\subdomains\ccsr\httpdocs\concrete\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php on line 78
JohntheFish replied on at Permalink Reply
JohntheFish
Uploading sql from windows to linux is a gotcha. Try searching the forums for 'lowercase' for much discussion and some answers, including an addon that may help.

http://www.concrete5.org/community/forums/installation/case-sensiti...
fcgleason replied on at Permalink Reply
fcgleason
I believe this is correct. My experience starting Concrete5 under Wamp with WindowsXP is that upper and lower case letters were created, causing errors on the linux based website server. I had to manually change table names to all lowercase.

"Uploading sql from windows to linux is a gotcha. Try searching the forums for 'lowercase' for much discussion and some answers, including an addon that may help."
pumacoat replied on at Permalink Reply
For two reasons. 1, the World Cup is not a trade-off does not qualify for a degree of armani sunglasses the country a standard football. China has often live is conflict, and sometimes extremely low self-esteem, conceited, easily falling prey to pretend sometimes meager particular, the cheap polo shirts link from the devaluation of the blind. North Korea national football team but did not qualify this time, with the first morning of fresh flesh is commendable, that is one-sided Bangsha Kunitari, its devaluation of the worth of a white, but never mind did not fall over on several occasions with the Chinese team Zheng Great World of North Korean nike dunk shoes, never mind do not drop the Chinese team has high morale, bloody full of beat Iran, Korea, France. Although the main World Cup, but only to a World Cup game that the DPRK as a crude idol of God, not to national gucci men shoes World Cup qualifying in 2010 as the Korean team on the back of dirty material, whether some are not properly and dignity off. 2, China and North Korea's economy and country than the it? If back 30 years ago, people like them to be woven back, and now shop fast economic development in China, you have to forcing my country like the back field and the Korean team chanel earrings, do not know is false or deceiving?


Have you let the morning take 12 yuan monthly fountain penof fresh buying LV unrealistic, so Kunitari take back millions of bags did not need an annual salary. If, for players to use your sink will be scolded products that developed lv handbag live in luxury Beckham, C Lo's career also are no days of luxury since the capacity of the. States national team players are all based on the battle for the country, incorporated into a wide levis jeans soon after, the Chinese national football players held the information of the original LV bag from the Recreation nhl jersey less. Since the Chinese professional league of business operations and economic environment of China to the foundation of these highly paid chanel handbags, and that the key is good these players can play with the best people on the self-worth.