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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Plano TechIT SpecialistCommented:
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
PranjalShahCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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 NisbetOwner 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Joomla

From novice to tech pro — start learning today.