CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • SOLVED! Failed upload of Joomla DB to remote server
Pages: [1]

Author Topic: SOLVED! Failed upload of Joomla DB to remote server  (Read 6106 times)

nuMedia

  • Guest
SOLVED! Failed upload of Joomla DB to remote server
December 13, 2007, 08:56:50 am
First, please bear with me as I try to describe this...

I've been developing a Joomla/CiviCRM 1.8 site locally on my Mac:
DB Version: 5.0.27-standard
PHP Version: 5.2.1
Web Server: Apache/1.3.33
Joomla! Version: 1.0.13

and, want to upload this work to:
DB Version: 5.0.24
PHP Version: 5.2.2
Web Server: Apache/2.0.52 (Red Hat)
Joomla! Version: 1.0.13

I copied the entire site folder, exported the database, modified the configuration.php file (this is the second time I've done this and it worked with no problems the first time.)

However, since the first time, I've installed CiviCRM and that is where the hang up is occurring (Table structure for table 'civicrm_acl'). I'm getting the following error when importing the database:

Code: [Select]
--
-- Database: `tccjoomla`
--
-- --------------------------------------------------------
--
-- Table structure for table `civicrm_acl`
--
CREATE TABLE `civicrm_acl` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique table ID',
`domain_id` int( 10 ) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
`name` varchar( 64 ) COLLATE utf8_unicode_ci default NULL COMMENT 'ACL Name.',
`deny` tinyint( 4 ) NOT NULL default '0' COMMENT 'Is this ACL entry Allow (0) or Deny (1) ?',
`entity_table` varchar( 64 ) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)',
`entity_id` int( 10 ) unsigned default NULL COMMENT 'ID of the object possessing this ACL',
`operation` enum( 'All', 'View', 'Edit', 'Create', 'Delete', 'Grant', 'Revoke' ) COLLATE utf8_unicode_ci NOT NULL COMMENT 'What operation does this ACL entry control?',
`object_table` varchar( 64 ) COLLATE utf8_unicode_ci default NULL COMMENT 'The table of the object controlled by this ACL entry',
`object_id` int( 10 ) unsigned default NULL COMMENT 'The ID of the object controlled by this ACL entry',
`acl_table` varchar( 64 ) COLLATE utf8_unicode_ci default NULL COMMENT 'If this is a grant/revoke entry, what table are we granting?',
`acl_id` int( 10 ) unsigned default NULL COMMENT 'ID of the ACL or ACL group being granted/revoked',
`is_active` tinyint( 4 ) default NULL COMMENT 'Is this property active?',
PRIMARY KEY ( `id` ) ,
KEY `index_acl_id` ( `acl_id` ) ,
KEY `FK_civicrm_acl_domain_id` ( `domain_id` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =1;

MySQL said: Documentation
#1046 - No database selected

Sorry for all of that because the error "#1046 - No database selected" is obviously the error... but, what does that mean?

Any, and all, help is greatly appreciated!
« Last Edit: December 15, 2007, 09:57:51 am by nuMedia »

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Failed upload of Joomla DB to remote server
December 13, 2007, 11:29:32 am
Try this. It's from a dump I did recently:

Code: [Select]
DROP TABLE IF EXISTS `civicrm_acl`;
CREATE TABLE `civicrm_acl` (
  `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique table ID',
  `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'ACL Name.',
  `deny` tinyint(4) NOT NULL default '0' COMMENT 'Is this ACL entry Allow  (0) or Deny (1) ?',
  `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)',
  `entity_id` int(10) unsigned default NULL COMMENT 'ID of the object possessing this ACL',
  `operation` enum('All','View','Edit','Create','Delete','Grant','Revoke') collate utf8_unicode_ci NOT NULL COMMENT 'What operation does this ACL entry control?',
  `object_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'The table of the object controlled by this ACL entry',
  `object_id` int(10) unsigned default NULL COMMENT 'The ID of the object controlled by this ACL entry',
  `acl_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'If this is a grant/revoke entry, what table are we granting?',
  `acl_id` int(10) unsigned default NULL COMMENT 'ID of the ACL or ACL group being granted/revoked',
  `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  PRIMARY KEY  (`id`),
  KEY `index_acl_id` (`acl_id`),
  KEY `FK_civicrm_acl_domain_id` (`domain_id`),
  CONSTRAINT `FK_civicrm_acl_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `civicrm_acl`
--

/*!40000 ALTER TABLE `civicrm_acl` DISABLE KEYS */;
/*!40000 ALTER TABLE `civicrm_acl` ENABLE KEYS */;


It adds the foreign key constraints, and has a few other minor differences. Are you using phpmyadmin?

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

nuMedia

  • Guest
Re: Failed upload of Joomla DB to remote server
December 13, 2007, 12:30:13 pm
Thank you, Brian,

It was your post that I found after I posted this question where you suggested re-installing CiviCRM on the remote site so it could make new tables and then massaging your SQL DB to eliminate the "create table" (is that correct?) part of the DB. Not sure of my terminology here...

but, I'm assuming the code you've sent here is what you ended up doing to accomplish that. Thank you!
Now, the "newbie-ness" comes out... how and when, do I use your code? YES!.. I am using phpMyAdmin -- both locally and on the remote host.

So, could you give me the steps? I'm not sure if I do this a) locally to correct the problems in the local SQL DB or b) re-install CiviCRM on the remote host, create a new database named the same as the local one, import your code and then, upload my exported SQL DB?

Those are my best guesses... and I know I could be waaay off!

Thank you again,
Lynda 

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Failed upload of Joomla DB to remote server
December 13, 2007, 04:38:35 pm
I'm understanding that you're moving your Joomla installation and DB from your local/testing server to the production server. And that the SQL error was received during import on the production server. So I would try running the SQL snippet from phpmyadmin on that server. You can save it as a text file and import on the Import tab, or may be able to enter through the query tab (depending on what version is running).
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

nuMedia

  • Guest
Re: Failed upload of Joomla DB to remote server
December 13, 2007, 08:23:03 pm
You're understanding exactly correctly the relationship of the local, and production server. But can you verify this procedure?
  • 1. Do a new install of CiviCRM on the production server. Since CiviCRM does not exist there yet, I need to establish the tables... because, the 'civicrm_acl' table is the very first one in the (my) local database. So, since I'm getting stopped with the 'civicrm_acl' table, NOTHING is getting updated.
  • 2. Now, I run the snippet, e.g. I now have a fresh 'civicrm_acl' table but need to drop it to prepare for the import of my local DB.
  • 3. Import 'tccjoomla' DB (from local machine export) and... hope all is well.
I guess I'm wondering if just "massaging" the 'civicrm_acl' table will work or... if I'll get stopped at the second, and each subsequent, 'civi_xxx' table.

I really only have two events and a partial profile completed so far. Tell me truthfully, should I just dump all the CiviCRM tables from my local DB export and re-create this information on my production server? I guess I'm a "creature of habit" and like to design/develop locally and then, upload. But... with Joomla! and CiviCRM (so cool!), I'll gladly change my habits.

Thanks again... sorry to be needing step-by-step instructions. Just wanting to be extra careful.

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Failed upload of Joomla DB to remote server
December 14, 2007, 07:10:08 am
Ok, let's back up a bit. The problem is that CiviCRM isn't installing correctly on your remote server. And the installation process broke down when trying to run the SQL script that builds the CiviCRM tables. I was reading the description of your problem very superficially -- that the problem was just with the acl table. But I suspect none of the CiviCRM tables were created -- the acl table being the first table, that's where the breakdown happened, but it was not limited to that one table. Can you get into phpmyadmin on your remote and confirm? All the CiviCRM tables begin with civicrm_

If that's the case, the problem may be permissioning related on your server. The installation of CiviCRM crashes because it lacks the authorization (within Joomla) to run the sql scripts.

I have never personally experienced this problem, but I remember reading about this happening on some shared hosting environments. I probably read about the problem on the Joomla forums. To see if this is what's happening, try installing another extension in Joomla on your production server. The problem shouldn't be unique to CiviCRM -- it would likely affect any extension that has to create and populate a table on your server.

As I recall (memory fuzzy here), the issue is that your Joomla admin login somehow doesn't correspond to the admin-level access required by your hosting provider. In other words, your host is not recognizing your Joomla admin as authorized to run an SQL create table script on the MySQL database.

I'm bouncing around a bit, and shooting from the hip --
Did you install Joomla using Fantastico, or some other script installation tool built-in to your host's control panel? If so, did they ask you to create a MySQL username during installation? If you installed Joomla manually (uploading and unzipping the install file; navigating to that location through your browser and walking through the Joomla installation process), you would have needed to either install using the root user, or create a MySQL user/pwd separately and reference that in the installation process. In either case, use your host control panel (or phpmyadmin) to look at your MySQL users, and make sure whichever one that is used by Joomla has sufficient MySQL privileges. That may be what's causing the problem.

If you confirm that the problem is not unique to CiviCRM, but affects other extensions, and the MySQL user privileges are at sufficient level that they should be able to create tables, then try doing a search on the Joomla forums for this issue. It has to do with a disconnect between your Joomla user and MySQL user privileges.

Lastly, as a workaround, you could do the following --
1) Upload the components/com_civicrm and administrator/components/com_civicrm folders from your local installation to the remote host.
2) Export your Joomla db from your local installation using phpmyadmin. Create the database in phpmyadmin on your host and import this file into it. If you don't want all your Joomla tables affected -- just the CiviCRM tables -- you will need to open the file in a text editor and delete the jos_ tables. You may also need to do a find/replace in that file (with a text editor) to make sure the database name matches the database name on your host. Most hosts have restrictions on the database name, prefacing each name with the username of your account with them.
3) Update the civicrm.settings.php file in both of the above folders (in #1). There are two of these files, one in each directory.

This "should" allow you to get CiviCRM up and running on your host. However, it doesn't address the real issue, which is lack of permission to run SQL via Joomla. That's going to affect other extensions, and probably be a pain in the butt moving forward with your site development.

Hope this helps.
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

nuMedia

  • Guest
Re: Failed upload of Joomla DB to remote server
December 14, 2007, 11:56:58 pm
Quote from: lcdweb on December 14, 2007, 07:10:08 am
Lastly, as a workaround, you could do the following --
1) Upload the components/com_civicrm and administrator/components/com_civicrm folders from your local installation to the remote host.
2) Export your Joomla db from your local installation using phpmyadmin. Create the database in phpmyadmin on your host and import this file into it. If you don't want all your Joomla tables affected -- just the CiviCRM tables -- you will need to open the file in a text editor and delete the jos_ tables. You may also need to do a find/replace in that file (with a text editor) to make sure the database name matches the database name on your host. Most hosts have restrictions on the database name, prefacing each name with the username of your account with them.
3) Update the civicrm.settings.php file in both of the above folders (in #1). There are two of these files, one in each directory.

Hi Brian (and whomever else might happen upon this thread in the future)
After an exhausting day of what seems like 15,000 different ways of trying to get my remote installation to appear, and include, the same content as my local installation, I am probably going to do as you suggest above. One of my unsuccessful little exploits today was to try to replace just the JOS tables (long story why the JOS... has to do with believing an eBook author this summer who said to create all content as static... grrrr). I've revamped all of that static content into Sections > Categories and I really, really would like that updated on the remote installation. However, when I tried to import only the JOS info, I received the same #1050 error - table 'jos_banner' already exists. So, I'm going to first archive the remote DB -- hopefully, it will be trash-able after... DROPPING all of the tables in that same remote DB (clean slate) and then importing my local DB (same name, reviewed in TextWrangler for any differences) into the remote server.

My original question, of course, had to do with CiviCRM but, as I said in the previous post, I only had two events and one profile developed. So, I've got a fresh install of CiviCRM on the remote now and I'm ready to go with that.

I'll let you know how this NEW technique works out. I really want to know as much as possible about what is going on because I'm hoping to continue to develop sites for others. If moving them is this hard...whew.  I think I saw somewhere where you, Brian, said you use WAMP or MAMP? I'm on a Mac and thought about using MAMP but then, I read too much, and someone said it wasn't good for multi-site developments. Which are you using?

Thank you again for your patience and detailed replies,
L
« Last Edit: December 15, 2007, 12:00:55 am by nuMedia »

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Failed upload of Joomla DB to remote server
December 15, 2007, 03:53:05 am
I use Windows, so I'm on WAMP. And it's fine for multi-site development (I probably have ten sites currently setup on it). But I know nothing about the Mac equivalent.
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

nuMedia

  • Guest
Re: Failed upload of Joomla DB to remote server
December 15, 2007, 09:56:15 am
SUCCESS!... and I will be out of everyone's bidness!

I did completely replace the remote DB (named, and configured, exactly the same way as my local installation) with the export DB from the local Joomla! site.

As Brian cautioned, civicrm.settings.php in
  • the components/com_civicrm directory, and
  • administrator/components/com_civicrm directory
were revised with the remote server's domain path.

And, for a very helpful site, and specifically, info on "How to Move Your Joomla! Site to a New Server," try http://www.howtojoomla.net/content/view/17/2

Thanks once again, Brian, for being my "main man!"
L

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • SOLVED! Failed upload of Joomla DB to remote server

This forum was archived on 2017-11-26.