0

I'd like to import a single table from a .sql file stored on my Ubuntu linux machine, into my database, also local.

the .sql file is just called 'dump.sql' and the database im importing into is called 'magento'. the table is called 'catalog_product_website'.

both the .sql file and 'magento' database has the table already, the .sql file just has a ton more information in it that i want.

thank you.

James
  • 529
  • 1
  • 7
  • 16
  • 1
    If it's a small dump you can just copy out the parts you want. If it's a large one you may need to restore the whole thing and delete what you don't want, or use a more specialized tool. – tadman Feb 19 '18 at 20:40
  • 1
    It's guessing, but typically such a dump contains SQL to create the tables and load their content, automatically generated from the content of an existing DB. So, you just need to run the code or parts of the code you are interested in. – Ulrich Eckhardt Feb 19 '18 at 20:43
  • @tadman Eh it's about 13GB, and I'd have to redo my local Magento CMS admin credentials and a bunch of other stuff that I'd rather not mess with and overwrite to be honest. Tons of variables to get Magento working locally that I've edited for instance. – James Feb 19 '18 at 20:43
  • Just restore it into a different database, then dump out specifically what you want. `mysqldump` has many options, but unfortunately there's no importer like there is with, for example, Postgres (`pg_restore`). You can always load this into a VM if necessary to exract precisely what you want. – tadman Feb 19 '18 at 20:43

0 Answers0