Export/backup (and restore) Gallery 3 ... erm, how?

stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Mon, 2010-09-20 23:44

Hi,

Hoping for some help with how to backup my gallery 3 installation. The G3 FAQ says in step 1 to:
"1. Export your database from server to disk using phpMyadmin or mysqldump". When I click on Export in phpMyAdmin I get a screen full of options - which ones should I set?

There are several panes within the "View dump (schema) of databases":
- Export:should I leave this set to "SQL"?
- Options: don't really understand these - just leave default values? (in Structure, "Add if not exists", "Add auto increment value" and "Enclose table and field names with backquotes" are checked; in Data, "Complete inserts", "Extended inserts", "Use hexadecimal for blob" are checked & Export type is "Insert")
- Save as file: preceded by a checkbox which is unchecked - is this optional?

gallery.aaltenvoogd.com/gallery3
Operating system: Linux 2.6.31.12.With.Dirk.Immutable+nfs_fingerprint
Apache: Apache
PHP: 5.2.13
MySQL: 5.1.43

Basically, I've managed to set up my Gallery 3 at the site above, with a full database (imported from Gallery 2) and now also have it running locally (VirtualBox + LAMPP) but without data so far. I'd like to make this an easily repeatable process, i.e. so I can develop on local site and transfer to the remote one.

Hope someone can help please?

Many thanks!

Stefan

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-09-21 04:15

We really need some volunteer to help out. How bout I get you started and you can fill in some blanks:

Here's a quick "how to backup a database with phpMyAdmin":

* Download the phpMyAdmin software if it's not available to you, install it (remember to password-protect it).
** more phpMyAdmin directions could go here.
* Point your browser to the location you installed it on ( how do we know where it is only your server , ask you host )
* Select the database you want to back up from the dropdown list in the left frame.
* In "View dump (schema) of database" select the table(s) you want to back up (press CTRL to select more than one table).
* Mark "Structure and data"
* Check "Save as file"
* Check "zipped"
* DON'T check "Add 'drop table'". It should be off by default.
* Press "go"
* Save the file on your harddisk (depending on the speed of your connection this could take a while).

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Tue, 2010-09-21 08:00

Should also cover the restore process ideally, with a step-by-step guide.

Is Gallery 3 structured in such a way as to allow a "Backup & Restore" plugin module to be written - to allow a "one-click" (or "several clicks") process, maybe wizard-driven?

I'm thinking of something akin to Akeeba Backup which I use with my Joomla site. This packages up the whole site (including, in this case, the Joomla installation, as well as the contents) and all you then do is copy the backup archive along with a kickstart script to wherever you want the site to be restored. This module alone has given me the confidence to try different things out with my site, knowing that I could easily revert to an earlier version (of course you have to remember to take regular backups). I wonder if the Akeeba Backup developers can be persuaded to write something similar for Gallery 3? (www.akeebabackup.com) - no I'm not on commission by the way - I just love this plugin with its friendly big green button! :-)

Stefan

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-09-21 13:50
Quote:
Should also cover the restore process ideally, with a step-by-step guide.

How did the steps above go? Did you make notes to share?

Quote:
Is Gallery 3 structured in such a way as to allow a "Backup & Restore" plugin module to be written - to allow a "one-click" (or "several clicks") process, maybe wizard-driven?

Yes but I suspect most hosts will have some restriction that will be hard to recover from.

Quote:
wonder if the Akeeba Backup developers can be persuaded to write something similar for Gallery 3?

Have you asked?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Tue, 2010-09-21 20:10

Thanks for the starter guide - if I get somewhere I'll try to write this up as a step-by-step guide but what I was hoping for was an automated tool/plugin/module & developing that is rather outside my own capabilities unfortunately.

I tried the steps above: Create a database dump, and it seemed to import successfully into my local Gallery 3 installation: after doing an import via phpMyAdmin, it nicely responded with a green tick and something like "242 queries successfully executed".

But ... no albums/photos appeared in my Gallery 3, and checking the local database again I note I now have duplicate-looking tables - e.g. "access_caches" and "g3trialaccess_caches", and so on for all tables (the "g3trial" bit came from the database on my web host). The "g3trial" prefixed tables have lots of content - I can see that by the row count in phpMyAdmin.

What have I done wrong? Any ideas/help would be very much appreciated (as I'm now well out of my depth!)

Many thanks!

Stefan

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2010-09-22 01:16

Sounds like the backup worked.
It looks like the restore from your backup had some table prefix the DB. (g3trial)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
andy duggan

Joined: 2006-05-21
Posts: 90
Posted: Wed, 2010-09-22 12:15

A module for this would be very useful ... if possible to also set an interval backup on the server. Most CMSs, messages boards etc do this.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2010-09-22 13:45

http://sourceforge.net/apps/trac/gallery/ticket/166

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Wed, 2010-09-22 14:16

Thanks for posting this on sourceforge as a ticket. I'm not familiar with the ins and outs of how stuff happens on sourceforge, but would it be worth changing this ticket to include both backup AND restore functionality, and ideally cover not just backing up/restoring the data but also the Gallery 3 system? As it is worded it will just create the backup, but with no indication of how to restore/recover, and taking the backup of the data is actually the easiest part of the process as it can be done easily within phpMyAdmin.

Ideally the backup should package up the whole system - Gallery 3 "system" as well as the data/albums/images - into a single archive.

The restore should unpack the whole lot and leave you with a working populated installation. All you should have to specify is the MySQL database details (host name, database name, login details) to restore into and - hey presto - you have the whole lot on a different host/server.

Hope that's not unreasonable?

 
stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Wed, 2010-09-22 15:25

Posted a note on the Akeeba Backup support forum:

https://www.akeebabackup.com/support/forum/topic.html?id=25993

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2010-09-22 15:36

Loginto source forge (registration is free). Update the ticket as you see fit. I did not create the ticket I just found it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Wed, 2010-09-22 17:25

Updated the ticket on SourceForge - http://sourceforge.net/apps/trac/gallery/ticket/166

Would be sóóó good to have this.

 
andy duggan

Joined: 2006-05-21
Posts: 90
Posted: Fri, 2010-09-24 07:49

Saw the ticket... you might have problems with emailing a gallery database - they seem to grow big very quickly. Mine zipped is 11MB or more - after cleaning out lots of stuff. Probably 200 albums and 4000 photos and no comments.

 
stefanaalten
stefanaalten's picture

Joined: 2004-08-23
Posts: 67
Posted: Fri, 2010-09-24 09:44

Sure, emailing a large backup archive is probably not sensible, and more suitable transfer methods exist. However, it's still important that you can somehow store your backup archive in a safe location (and not just leave it placed alongside the database - which rather obviates taking a backup in the first place! :-)

 
andy duggan

Joined: 2006-05-21
Posts: 90
Posted: Tue, 2010-09-28 09:36

Correct that... my gzipped sql file is 30MB.
Never seen any CMS type software that makes smaller split archive backups capable of being emailed. Most just place a file on the server in the admin folder which can then be downloaded easily.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2010-09-28 18:19

@andy duggan: that's pretty large. I suspect that the caches and sessions tables amount to at least 10% of that so you can try excluding them with -ignore-table="gallery3.caches,gallery3.sessions" if you're using mysqldump.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git