Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Changes of Tablenames at Database copy

hhoefling's profile image hhoefling posted 3 weeks ago in Feature discussion Permalink

Feature request

When I copy a database between (web) servers it often happens that the PHP software uses prefixes for the table names.

Sample: Piwig on Server A, "fuu_config" Piwig on Server B, "bar_config"

When I want to copy the table "config" then the table name prefix on the target-Server(B) must be changed.

My wish therefore: Optionally change "foo " -> "bar" in all table names of the target database

ansgar's profile image ansgar posted 3 weeks ago Permalink

That sounds like a new checkbox for the bulk table editor, doesn't it?

Description

hhoefling's profile image hhoefling posted 3 weeks ago Permalink

OK. I haven't used this dialog page yet.

I always use the "SQL export"

  • Drop / Create options
  • Data: "Insert ignore" or "replace existing"
  • Output-> DestServer
  • Database-> DestDatabase

With "Bulk-Table editor-> Move to Database" I don't know exactly what is happening

If you want to expand the "Bulk Table Editor" page then you should that also affect the "SQL export".

ansgar's profile image ansgar posted 3 weeks ago Permalink

With "Bulk-Table editor-> Move to Database" I don't know exactly what is happening

Is that relevant to your question?

If you want to expand the "Bulk Table Editor" page then you should that also affect the "SQL export".

I don't think so - why should the same feature be in two places?

hhoefling's profile image hhoefling posted 3 weeks ago Permalink

No, not duplicated the dialogue parts. Renaming should also be carried out with "SQL export".

Otherwise I cannot mix tables (with the "Insert Ignore" option) that have different prefixes.

ansgar's profile image ansgar posted 3 weeks ago Permalink

You want to rename tables in the export process itself? That's quite tricks, as there may be foreign keys and views with references to the original tables. And I'd like to keep the export dialog free from such "exotic" features. You could still use the above dialog, when you export to a temporary database first, then use the "Move to database" and "Rename table prefix" checkboxes in the bulk editor.

hhoefling's profile image hhoefling posted 3 weeks ago Permalink

Done. This works for me.

Restrictions:

  • Only Table Names are changed, no View or StoreProcedure
  • Works also for Export to Clipbord orSql-File
1 attachment(s):
  • Heid1
ansgar's profile image ansgar posted 3 weeks ago Permalink

This is just a mockup, isn't it?

As said, I'd like to keep the export dialog free from such "exotic" features.

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.