PDA

View Full Version : Query conflict with table prefix


markoroots
03-01-2015, 01:36 PM
Hi there,
I have moved my forum to a new url.
Now I'm changing all the old value to the new.

So I was running a query to change in all the forum the old name of the forum with the new one, but when I run the query it says that is there an error relative to the table prefix.

https://vborg.vbsupport.ru/external/2015/03/37.png

So is there someone that can help me to fix this?

Thanks in advance.

kh99
03-01-2015, 02:26 PM
The part before the dot is the database name. But if you have a table prefix defined in your includes/config.php file, then you need to include that before the table name.

For example, if your config.php has this:
// ****** TABLE PREFIX ******
// Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = 'vb_';

Then you would need:
UPDATE
vb_usertextfield
SET
signature =....etc

markoroots
03-01-2015, 05:31 PM
Hi Kh99 and many thanks for you reply.
The prefix in the config and also in the database is "vb_"

So I have to run the query in this way??

UPDATE
vb_usertextfield
SET
signature =vb_

kh99
03-01-2015, 05:42 PM
Well, you still need the rest of it there, I just didn't want to type it all. But it would be:
UPDATE
vb_usertextfield
SET
signature = REPLACE(signature, 'sigarettaeletronicaforum.it', 'sigarettaeletronicaforum.com')


Hopefully I spelled those right.

markoroots
03-01-2015, 06:33 PM
It come this error.

https://vborg.vbsupport.ru/external/2015/03/36.png

is there the dot hide before "vb_usertextfield"

kh99
03-01-2015, 06:41 PM
It come this error.

https://vborg.vbsupport.ru/external/2015/03/36.png

is there the dot hide before "vb_usertextfield"


No, if your table prefix is 'vb_', then I think that should have worked. Are you sure the prefix is vb_?

ForceHSS
03-01-2015, 06:55 PM
UPDATE `usertextfield` SET `signature`='text here'
if you are trying to put text in the sig field use the above query

markoroots
03-01-2015, 09:27 PM
Hi guys and thanks for your replies.
Yes the prefix on the database and also in the config is "vb_"
for this look strange...
do you think that with this query I can fix this issue?

UPDATE `usertextfield` SET `signature`='vb_'

bridge2heyday
03-01-2015, 09:33 PM
No , this will delete all signature text and set it to 'vb_' , I advice you not to do this yourself

--------------- Added 1425253065 at 1425253065 ---------------

If you are going to do it yourself , I recommend using this tool
https://github.com/interconnectit/Search-Replace-DB

markoroots
03-03-2015, 12:02 AM
Ahh ok. Good to know.
Thanks
So what I can do to fix this issue?

kh99
03-03-2015, 02:37 AM
Can you do this query:
show tables like '%usertextfield'

and post the result?

markoroots
03-04-2015, 09:30 AM
Hi,
this is the result:

vb4_usertextfield

kh99
03-04-2015, 10:02 AM
OK, then you want to do this:
UPDATE
vb4_usertextfield
SET
signature = REPLACE(signature, 'sigarettaeletronicaforum.it', 'sigarettaeletronicaforum.com')



You should have a backup of your database before trying things like this. A small mistake can cause you to lose data or cause your forum to break.

markoroots
03-04-2015, 01:22 PM
Thanks Kevin.
Done. :)
And now?

kh99
03-04-2015, 01:33 PM
And now?

I don't understand. When you say "Done", do you mean done making a backup? Then you're ready to try the query posted above.

markoroots
03-04-2015, 02:44 PM
Ah sorry...
I mean that I have made what you have said.
Made a db backup and I have started also the query you tell me.

The response is:
"Lines processed: 0"
All is gone with no errors.

markoroots
03-07-2015, 11:31 AM
Any news??

kh99
03-07-2015, 11:32 AM
Sorry, I'm not sure what you need. It sounded to me like you got it to work.

markoroots
06-29-2015, 08:21 AM
Wow sorry... :)
Was just finish what we were making about what I ask and everything is gone good.
Word changed. :)
Thanks again Kh99.