squirrel-sql-client / squirrel-sql-code

Share of the SQuirreL SQL source code originating from SourceForge, see https://squirrelsql.org
GNU Lesser General Public License v2.1
59 stars 11 forks source link

Database export/import tool from one DB to another DB #20

Open xbotuk opened 10 months ago

xbotuk commented 10 months ago

Database export/import tool from one DB to another DB

gerdwagner commented 9 months ago

Here are some features SQuirreL offers to copy data from one DB to another:

  1. Select tables in SQuirreL's Object tree and choose "Copy table" from the right mouse menu. Then go to another Session's Object tree and choose "Paste table" on your preferred destination schema/table type node.
  2. Select tables in SQuirreL's Object tree and use the "Scripts" submenus to script table DDLs and data insert statements. This method is suitable for a limited amounts of data only.
  3. SQL results can be exported using the right mouse menu either on the result tables or on the SQL statement. (For information on advanced exporting methods click the "About exporting link ..." at the bottom of the export dialog.) To import the exported data into another database use the import menu in the Object tree's right mouse menu.
gerdwagner commented 9 months ago

The latest snapshot available here https://github.com/squirrel-sql-client/squirrel-sql-snapshot-releases/releases/tag/snapshot-20231004_0026 or here https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20231004_0026/ offers two more exporting options, see the following excerpt from our change log:

Object tree: New right mouse menus in "Scripts" submenu: "Store selected tables' data in files" and "Create INSERT statements file from selected tables"

A function to import data of several formats is available in the Object tree's right mouse menu or the menu Session --> "File import".