Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2008, 10:17 PM
Toupsx Toupsx is offline
 
Join Date: Aug 2008
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Importing MYSQL Column Data for VBCredits from other Database?

Greetings, here's what my problem is:
I have just recently imported my board from SMF to VB with Implex, working great. Of course it couldn't take the credit information with it. In my SMF board the table Members (same as the table User in VB pretty much) had two columns called money and moneyBank going along with each member's row. Now in VB I installed the mod VBCredits which put in the columns credits and credits_saved corresponding to each user's row. What I want to do is take the data from the money row from my old forum and put it in the new credits row in my new forum.. and the same for moneyBank & credits_saved..

They are basically the same exact thing just different names.

I'm inexperienced with SQL queries or importing/exporting data with specific columns like this so if anyone could help that would be amazing.
Reply With Quote
  #2  
Old 08-21-2008, 06:32 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.
Reply With Quote
  #3  
Old 08-21-2008, 10:20 AM
Toupsx Toupsx is offline
 
Join Date: Aug 2008
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.
Its a mysql question.. not style or mod.. I asked in VBCredits' mod topic and he said post here/at vbulletin.com because he doesn't know how.. so.. yeah..
Reply With Quote
  #4  
Old 08-21-2008, 11:08 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well we don't have any knowledge of the database stucture used in these modifications, they are really the only ones that can give a correct answer.
Reply With Quote
  #5  
Old 08-21-2008, 02:40 PM
Toupsx Toupsx is offline
 
Join Date: Aug 2008
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Well we don't have any knowledge of the database stucture used in these modifications, they are really the only ones that can give a correct answer.
Read my first post please.. not looking to import everything from them.. I'm looking for help to import two single columns into the User table from another database whos member table is basically the same thing.. really has nothing to do/no needed information for either of the modifications.. its the default Vbulletin database structure for the User table.. with just two columns that I want to import data to..
Reply With Quote
  #6  
Old 08-21-2008, 02:44 PM
Regs Regs is offline
 
Join Date: Oct 2001
Location: Vancouver BC
Posts: 322
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe what he is asking is pretty straightforward in the sense that it doesn't matter which modification he is using.

The point being made is that both structures are the same just the 2 columns are names differently. On one side, the 2 columns has all the data and the other has none.

To the original poster, one avenue you might want to try is export the 2 tables using phpmyadmin, open them up in a spreadsheet and copy the data over from one file to the other. Then import back using phpmyadmin.

This is of course assuming that the userids in both tables match up, if not, you might need to do some 'massaging'.

I would test this out on a test install first.

There are probably much better ways of doing this but you'll need a helpful coder here to get you going.

Cheers,

Regs.

--------------- Added [DATE]1219333529[/DATE] at [TIME]1219333529[/TIME] ---------------

I should add that when I say copy the data over, I mean just the 2 columns, not everything
Reply With Quote
  #7  
Old 08-21-2008, 02:55 PM
Toupsx Toupsx is offline
 
Join Date: Aug 2008
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Regs View Post
I believe what he is asking is pretty straightforward in the sense that it doesn't matter which modification he is using.

The point being made is that both structures are the same just the 2 columns are names differently. On one side, the 2 columns has all the data and the other has none.

To the original poster, one avenue you might want to try is export the 2 tables using phpmyadmin, open them up in a spreadsheet and copy the data over from one file to the other. Then import back using phpmyadmin.

This is of course assuming that the userids in both tables match up, if not, you might need to do some 'massaging'.

I would test this out on a test install first.

There are probably much better ways of doing this but you'll need a helpful coder here to get you going.

Cheers,

Regs.

--------------- Added [DATE]1219333529[/DATE] at [TIME]1219333529[/TIME] ---------------

I should add that when I say copy the data over, I mean just the 2 columns, not everything
Hello, yes that basically sums it up, I tried exporting the data & then importing it selecting "just the columns I wanted" in the import.. didn't work, it completely erased the user (made it on a test user just importing those two columns for just it). So yeah. if someone could give me some better instructions on how to do it or a better way to do it, would be great.
Reply With Quote
  #8  
Old 08-21-2008, 02:56 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have no experience with MySQL then you may want to consider hiring someone to do it for you. If there was an easy answer, someone would have given it by now. My best guess would be that you'd need to use an "UPDATE" possibly with a join (if thats possible in update queries).
Reply With Quote
  #9  
Old 08-21-2008, 03:28 PM
Toupsx Toupsx is offline
 
Join Date: Aug 2008
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
If you have no experience with MySQL then you may want to consider hiring someone to do it for you. If there was an easy answer, someone would have given it by now. My best guess would be that you'd need to use an "UPDATE" possibly with a join (if thats possible in update queries).
It really doesn't seem that hard of a thing.. you have 1 database with 2 columns with data in them.. you have another database with 2 columns with the exact same set up with no data in them... you take data from database 1 and put it in database 2.

That's all I want.. all these mod makers and such do a lot more & harder SQL things I'm sure so really don't think it would be worth spending money on.. seems like a 5 minute job for someone that actually knows how to do it.. really only want this to save me from putting in the data manually for each user..
Reply With Quote
  #10  
Old 08-22-2008, 02:41 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Toupsx View Post
It really doesn't seem that hard of a thing.. you have 1 database with 2 columns with data in them.. you have another database with 2 columns with the exact same set up with no data in them... you take data from database 1 and put it in database 2.
assuming both databases are on the same system:

[sql]
update vbdatabase.user u, otherdatabase.credittable o
set u.newfield1=o.oldfield1, u.newfield2=o.oldfield2
where u.userid=o.userid
[/sql]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04281 seconds
  • Memory Usage 2,254KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete