how can I import tables from one database into another database in MySQL

Hi there,
I have  some tables from one database that I would like to import into another database.

I don't want to import the entire database, just some select tables.

In particular I am wanting to import tables from a Virtuemart 1.0 version into a database with Virtumart 1.1 tables...
Can I do this?
LVL 11
Amanda WatsonWeb DeveloperAsked:
Who is Participating?
 
PranjalShahConnect With a Mentor Commented:
You can export your table as .sql file from one database save it on a drive and then import that sql file on another database...
0
 
mmarisCommented:
Here are some tools to help you accomplish this:

http://extensions.virtuemart.net/index.php?option=com_sobi2&catid=12&Itemid=2

-PT
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
I am trying to use csvimproved but I cannot get it to install in joomla 1.0 so I don't know how to export my vm from 1.0??
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
nanharbisonCommented:
Do you have access to phpMyAdmin on your webhost? It is easy to export tables there.
0
 
PranjalShahCommented:
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
I have access to phpMyAdmin

So I simply select the tables I want to export from my old database and then what with my new database?

The new database already has the tables created, they just don't have the data, so how to I get the data from the old table to the new table?

0
 
PranjalShahCommented:
You can add a SQL to the file in the beginning...

DROP TABLE IF EXISTS tbl_name
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
ok so what exactly do I do.

Say I have a table jos_products and I want to fill it with the old information do I write an SQL query and what exactly do I write?
0
 
PranjalShahCommented:
At the beginning of the your exported file, write

DROP TABLE IF EXISTS jos_products

this way it will drop your existing table and recreate with the new one along with the data.
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
and then do i import this file into my new database?
0
 
PranjalShahCommented:
Yea..
0
 
Allan NisbetConnect With a Mentor Owner at Storm IT Solutions LTDCommented:
Dont use drop table when going from 1.0 to 1.5 though as I posted in the other thread as it can cause issues on the tables with updated variables.

Phpmyadmin will create your files automatically

just tick the boxes next to tables you want then export and it will do the rest for you

http://www.codingforums.com/showthread.php?t=22880

this is the detail to the above method

Storm
0
 
nanharbisonCommented:
You should back up the database before you do anything, just in case you mess up, so you can get everything back.
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
Hey Storm,
Before I do all of this I read this post
http://www.nultz.com/virtuemart-migration-from-1-0-to-1-1.html
I thought you had to upgrade to vm 1.1 to use the migrator?
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
Hi again Storm.
I can't seem to get a smooth run of imported my vm tables.

I did my products and categories succesfully but most of the other tables I got errors.

Which tables do you usually export across?

0
 
lazysheepmediaCommented:
Its difficult to know when exporting tables to a ne version that hat you are dooing is right. I say this because very often the new tables may have new or old columns in the table. Resulting in errors such as "unknown column jos_products_old" for example

I always use navicat and export the data I want without interfering ith the table itself

Regards
0
 
lazysheepmediaCommented:
sorry my W key is faulty :)
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
Thanks for this.
I ended up using the mtwMigrator in a fresh install of Joomla 1.5 and V 1.1.4

Seems to all be working nicely now!
0
 
Amanda WatsonWeb DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.