phpMyAdmin

What options to check when exporting database from phpMyAdmin?

Benevolent correspondent Jason asks:

Which is appropriate to be 'checked' under "structure", when backing up a Drupal database in phpMyAdmin, from the options below?

-Add DROP TABLE
-Add IF NOT EXISTS
-Add AUTO_INCREMENT value
-Enclose table and field names with backquotes
-Add CREATE PROCEDURE / FUNCTION

Question answer

The procedure I use to back up a database is the Export function in phpMyAdmin: export the whole online database to a single compressed file, and when/if the database needs to be restored, import that saved file back into the online database. The whole procedure wasn't immediately clear to the phpMyAdmin newbie I was at first – and to be honest, I haven't learned a heck of a lot about phpMyAdmin in the meantime – but a little poking around showed the export procedure to be easy.

Here's my export page:

 

phpMyAdmin screen

 

In response to the question, I've always had three of the "Structure" options checked by default when I've exported databases, and never had trouble exporting or importing (despite heavy use of contrib modules).

The three checked options, as shown in the image:

-Add IF NOT EXISTS
-Add AUTO_INCREMENT value
-Enclose table and field names with backquotes

Left unchecked:

-Add DROP TABLE
-Add CREATE PROCEDURE / FUNCTION

I don't know of specific circumstances that would require me to change the Structure selections – or anything else under "Options" – so I've never touched them. I just make one vital click: "Select all", under "Export", so all of my database's tables get exported.

Moving on to the bottom of the page:

 

phpMyAdmin screen

 

I click "Save as file", select a form of compression (the exported files can be too big to re-import, otherwise!), and hit "Go". That's it: one backup file saved to disk, to be squirreled away (and studiously backed up again to an external drive!).

The above works for me. Backups are dead serious stuff, so be sure to experiment, and consult with a phpMyAdmin expert if possible, to see whether the right procedure for you calls for some changes.

Syndicate content