Wedge

Public area => The Pub => Importing into Wedge => Topic started by: Farjo on January 23rd, 2014, 02:29 AM

Title: Database permissions
Post by: Farjo on January 23rd, 2014, 02:29 AM
So yes the absolute path works fine and I amended the opening post.

If the wedge database user does not have permission to the smf database then the following message is given:
Sorry, the database connection information used in the specified installation of Wedge cannot access the installation of %1. This may either mean that the installation doesn't exist, or that the MySQL account used does not have permissions to access it.

The error MySQL gave was: 'SELECT command denied to user 'wedgeuser'@'localhost' for table 'smf_members'


Obviously the importer works if the SELECT premission is given to the wedge user on the smf database.
Title: Re: Database permissions
Post by: havok on January 24th, 2014, 11:05 AM
I get  error
Unknown column 'override_theme' in 'field list

cannot import boards'
Title: Re: Database permissions
Post by: havok on January 27th, 2014, 02:34 PM
i am getting this error
SELECT
id_board, id_cat, child_level, id_parent, board_order, id_last_msg, id_msg_updated, member_groups,
id_profile, name, description, num_topics, num_posts, count_posts,
override_theme AS override_skin, unapproved_posts, unapproved_topics, redirect, id_board AS url

caused this error
    Unknown column 'override_theme' in 'field list'
Title: Re: Database permissions
Post by: Nao on January 27th, 2014, 04:16 PM
Are you sure you entered the right paths..? Because to me, it sounds like you tried to import a Wedge forum into another Wedge forum. (Or worse, into a SMF forum... :P)
Title: Re: Database permissions
Post by: TE on January 27th, 2014, 05:39 PM
Quote from Nao on January 27th, 2014, 04:16 PM
Are you sure you entered the right paths..? Because to me, it sounds like you tried to import a Wedge forum into another Wedge forum. (Or worse, into a SMF forum... :P)
Yep, that's what I think, too.. the path to SMF seems wrong.
Title: Re: Database permissions
Post by: havok on January 27th, 2014, 08:35 PM
Quote from Nao on January 27th, 2014, 04:16 PM
Are you sure you entered the right paths..? Because to me, it sounds like you tried to import a Wedge forum into another Wedge forum. (Or worse, into a SMF forum... :P)
yeah,  i had not changed the path that was automatically filled in by the importer. now the smf database wont allow access to wedge. i think its my settings on godaddy, but the admin panel has no option to change the priviledges.

error msg
The error MySQL gave was: 'SELECT command denied to user ,,, on table smf_members

Title: Re: Database permissions
Post by: Nao on January 27th, 2014, 11:26 PM
That's the problem that was discussed; apparently, the importer doesn't try to 'impersonate' each database setting. You can fix it by giving your Wedge database user, some extra rights on the SMF database.

Thorsten, what do you think should be done about this..?
Title: Re: Database permissions
Post by: TE on January 28th, 2014, 07:42 AM
Quote from Nao on January 27th, 2014, 11:26 PM
Thorsten, what do you think should be done about this..?
Mhh, it's a bit complicated..

The SMF importer could read Settings.php from the SMF install in order to select the proper database Name and credetials (username and Password for the MySQL database) but other vendors (phpBB, MyBB, vBulletin etc.) don't have their own Settings.php. They have equivalents, but the credentials are sometimes stored in an Array, sometimes in a CONSTANT,  sometimes in private class vars etc.,..so it's not suitable to grab these from the related files.

An option would be to ask for credentials and store these in a php session var or in a Cookie. Not sure if it's worth the amount of work and the "Trouble" regarding security... I'm not a big fan of storing the cleartext-version of MySQL Password in a Cookie or a session var.

See it as a system requirement: The importer is running in Wedge's database context and the Wedge installation needs read-access from the other system's database in order to import the old data.
Title: Re: Database permissions
Post by: Farjo on January 28th, 2014, 12:27 PM
How about some text next to the database user input box stating that this user requires the Select permission on the SMFdatabase? Or another pair of input boxes for SMF db user & password?
Title: Re: Database permissions
Post by: Nao on January 28th, 2014, 01:19 PM
@TE, while I'm happy that the importer is smart enough to import from other systems, I think realistically we can assume that most Wedge users will be coming from a SMF background, at least until it gets popular enough to stand as an unmissable forum package.
For that reason, it might be best to go the extra length for SMF users.

Also, I thought that since the import script has access to the source's Settings.php, it could very easily re-use this file's user name & password when connecting to the source database..?

@Farjo, I think that what bothers Thorsten is the fact that these db user & password would be stored in a clear text file. However, it could just as well be stored in $_SESSION. I'm not exactly sure why it's a problem at all. The importer has little chance of compromising your website anyway.
Title: Re: Database permissions
Post by: MultiformeIngegno on January 29th, 2014, 09:25 PM
So, I have SMF installed in the same VPS of Wedge. They are on 2 different databases run by (respectively) say smfuser and wedgeuser (same mysql server).
Both smfuser and wedgeuser have GRANT ALL privileges on their respective databases (say smfdb and wedgedb).

To be sure Wedge Importer had the right permissions to access the SMF database I run:
Code: [Select]
GRANT ALL PRIVILEGES ON smfdb.* To 'wedgeuser'@'localhost' IDENTIFIED BY 'wedgeuserPASSWORD';

I still get this..:
Quote
Sorry, the database connection information used in the specified installation of Wedge cannot access the installation of %1. This may either mean that the installation doesn't exist, or that the MySQL account used does not have permissions to access it.

The error MySQL gave was: 'SELECT command denied to user 'wedgeuser'@'localhost' for table 'smf_members'
Posted: January 29th, 2014, 09:20 PM

Updated the post to be more clear.. reload page :P
Title: Re: Database permissions
Post by: Nao on January 29th, 2014, 10:10 PM
If anyone's waiting for my feedback -- I'm really bad at MySQL. I can use it, but the intricacies like granting privileges..? I have no frigging idea how to debug that. I'll leave it up to Thorsten to share his opinion, or anyone who's better than me at MySQL anyway.
Sorry about that.

Have you tried googling it?
Title: Re: Database permissions
Post by: Farjo on January 29th, 2014, 10:41 PM
This is the command that phpMyAdmin runs on my database:
Code: [Select]
GRANT SELECT ON `smfdb`.* TO 'wedgeuser'@'localhost';
Other than the ` characters there doesn't seem to be any difference. :hmm:

You only need SELECT - indeed I'd argue that to give anything more risks the assurance that the converter will not alter your SMF database :^^;:

What's the command to show a user's permissions?
Title: Re: Database permissions
Post by: Harz-FEAR on January 29th, 2014, 11:03 PM
Quote from Farjo on January 29th, 2014, 10:41 PM
What's the command to show a user's permissions?
Code: [Select]
SHOW GRANTS FOR CURRENT_USER();
Title: Re: Database permissions
Post by: Pandos on January 29th, 2014, 11:57 PM
Quote from MultiformeIngegno on January 29th, 2014, 09:25 PM
So, I have SMF installed in the same VPS of Wedge. They are on 2 different databases run by (respectively) say smfuser and wedgeuser (same mysql server).
Both smfuser and wedgeuser have GRANT ALL privileges on their respective databases (say smfdb and wedgedb).

To be sure Wedge Importer had the right permissions to access the SMF database I run:
Code: [Select]
GRANT ALL PRIVILEGES ON smfdb.* To 'wedgeuser'@'localhost' IDENTIFIED BY 'wedgeuserPASSWORD';

I still get this..:
Quote
Sorry, the database connection information used in the specified installation of Wedge cannot access the installation of %1. This may either mean that the installation doesn't exist, or that the MySQL account used does not have permissions to access it.

The error MySQL gave was: 'SELECT command denied to user 'wedgeuser'@'localhost' for table 'smf_members'
Posted: January 29th, 2014, 09:20 PM

Updated the post to be more clear.. reload page :P
Did you do the following?:
Code: [Select]
flush privileges;
Please run the following statement and post the output:
Code: [Select]
select host, user from user;
Title: Re: Database permissions
Post by: havok on January 30th, 2014, 10:46 PM
myphpadmin does not have the option to grant any privileges, restricted by the host because i am on a budget shared hosting blah blah according to online support
option 1 is to switch hosts (any suggestions)
option 2 is there a way to manually transfer the members and other important settings only without importer
option 3 send password reset to all members and start afresh.



Title: Re: Database permissions
Post by: Nao on February 2nd, 2014, 12:58 PM
Hopefully split everything into this topic correctly.
Needs attention, I think!
Title: Re: Database permissions
Post by: TE on February 2nd, 2014, 02:59 PM
There's an easy solution: Install both forums (SMF and Wedge) in the same database. They use different prefixes (SMF tables start by default with smf_ and Wedge tables start with wedge_ by default.

Title: Re: Database permissions
Post by: havok on February 2nd, 2014, 08:44 PM
:cool:
putting smf and wedge in the same data base worked fine. thank you very much @TE .
Title: Re: Database permissions
Post by: Nao on February 3rd, 2014, 01:35 PM
It's a cop-out! :lol:

Although, yeah, my problem is that I've never tried installing Wedge on a different database, because, well, I only have the one... :^^;:
Also, one would think that if you're thinking of 'upgrading' your forum to Wedge, you'd want to keep changes to a minimum, so... Same database, really.
Title: Re: Database permissions
Post by: eolith on February 13th, 2014, 05:04 AM
Importer failed with the same error for me (hosting with GoDaddy), so I installed into the same database. The importer worked in many places, but missed several boards. I got errors on the attachments and other places. Because it only offered a "Try Again" button, I'd advance the substep numeral to continue.

I used the SMF2 .xml file.
Title: Re: Database permissions
Post by: Nao on February 13th, 2014, 07:38 AM
You should post screenshots of your latter errors.

Tipping @TE.
Title: Re: Database permissions
Post by: eolith on February 13th, 2014, 11:04 PM
Importer01.png = All checkboxes selected during setup.


First Error comes after the pause, and this is the URL:
http://www.exile-guild.com/wedge/import.php?step=1&substep=3&start=500

ImportAttachmentsError01.pdf = First error during importing attachments.

Now, since there's a If I advance the URL to:
http://www.exile-guild.com/wedge/import.php?step=1&substep=3&start=501
I get the same error, but the error is now "Duplicate entry '1122' for key 1."

so I tried advancing the start # a couple more times, the entry number increases accordingly. However, the last number "1415" remains the same. So I advanced the start value to 620 (which should be the last one). No error resulted.

No further errors. Last time I advanced the substep and got two errors.

Also, on all 3 import attempts, the import.php file is not removed upon checking the box. This does not work during the forum software install, either.

Importer02.png shows the checkbox selected, and Importer03.png shows the forum software finding import.php

So it seems advancing the start value made all the difference, I now have an exact number of topics and posts, however I have one extra member, so I'm thinking that's the auto-created admin account.
Title: Re: Database permissions
Post by: Pandos on February 14th, 2014, 12:11 AM
The duplicate entry thingy is perhaps easy to solve.
Just edit in import.php line 1384 and adjust the limit to a treshold of 200 instead of 500.
Also it's recommended to lift up your server timeout settings in PHP.


If the duplicate error is persistent, then put the next higher value +200 .
Title: Re: Database permissions
Post by: Pandos on February 14th, 2014, 12:12 AM
Please report if this solved your problem.
Title: Re: Database permissions
Post by: Nao on February 14th, 2014, 12:45 AM
+1.

Also, if file can't be deleted with a click, you should check that your folder permissions (chmod) are okay.