Getting an SQL dump from VirtualMin ?


I have a 3 databases on one of my servers and I want to copy the structure onto a new server. I know that in phpadmin you can get an SQL dump of just the structure and quickly run it as a query to create all the tabels. Can ı getan SQL dump fro the virtualMin "Edit Databases" ?

If not should I install phpadmin or is there an easier alternative ?



Yeah, I believe you can do that by going into Edit Databases, choose "Manage" next to the one you want to dump, and click "Backup Database".

You can also do it from the command line using mysqldump.

Thanks for your reply

I did that and it seems to work well.

After doing vt the backup I went to Webmin File Manager to look at the file. It obviously created with the intention of restoring t5he dats later on as it the drop command before each table.

One thing I did not undertand was this bit:

/*!40000 ALTER TABLE contact DISABLE KEYS /;
INSERT INTO contact VALUES (1,‘Fred’,‘’,’’,‘helkp’,‘ajjya uyaery ty yto’),(2,‘Fred’,‘’,’’,‘helkp’,‘yune ue6ue’);
!40000 ALTER TABLE contact ENABLE KEYS */;

I have not used that /*!40000 - what is that doing ?

Well, I’d imagine anything wrapped in a /* … */ is a comment and is not actually executed.

I’m not sure what the meaning of the !40000 would be – but “disable keys” turns off indexes, and “enable keys” turns them back on.

A reason to do that is that it can be a significant performance boost to enable indexes for all records at once, rather than setting them one at a time when they’re being inserted into the DB.

So as a wild guess – perhaps that performance boost only becomes “significant” after 40000 records, so those lines are commented out until you have enough data? That’s just a guess though :slight_smile:

Those commands are described here in the MySQL alter table reference:

That looks like a pretty good guess !

I thought they were commented out but couldn’t see why an automatic script would do that - but what you say makes sense.