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.

Average: 3.1 (11 votes)

Re: What options to check when exporting database from phpMyAdmi

This is great info...
I finally was able to back-up and restore without major issues...

I am currently trying to figure out how to use phpmyadmin to "update" my site when working with the files off line.

When I use this system it overwrites everything. (great for what it is intended for!)

What I am trying to do is prevent the situation where if a use adds a comment to the top story, I make some offline changes (add a feature, change a title, etc...) over the course of a day or so when I export the database and upload it... it replaces everything and the comment that the person added inbetween is gone...

Q: How do i get phpmyadmin on my production site to import only the CHANGES in databases? It has to be possible I am just stuck...

Thanks,
Saneangel

Re: What options to check when exporting database from phpMyAdmi

Let me see whether I understand: You download an active site's entire database at times, perform site maintenance using that downloaded database (and, I assume, a local installation of Drupal), and when finished want to update the active site by uploading the modified local database. Is that right?

I have to admit lack of experience with doing the same; I've been brave (dumb?) enough to perform work on "live" sites. It seems to me that if you're just changing node content (node text, titles, etc.), there shouldn't be any harm in doing it on the live site. Just edit nodes live, and the next visitor who comes to that node or refreshes its page will see the changes. But perhaps you're talking about much bigger changes to the site?

In any case, I would think that what you want is a merge function for the two databases - or, to be more efficient, just for the tables that you know you've modified. I did some searching for phpMyAdmin and merge, and found some interesting stuff like this:

http://drupal.org/node/201369

http://www.everymanhosting.com/forum/viewtopic.php?p=42

but I haven't seen a good overview specifically aimed at those just wanting to merge a few locally-changed nodes or tables.

Any other readers have an idea?

 

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><br><p>
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
Sorry for the "captcha" spam-detector challenge; the spammers have been out in force. : (
intere_ting: