Backup

ae6dx

Joined: 2003-02-04
Posts: 74
Posted: Sat, 2004-07-31 21:30

How do I backup pictures, albums, and data in G2?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sat, 2004-07-31 21:33

We only store data in the gallerydata directory (as specified in your config.php) and the database. So back up those two (tar up the directory, dump the database however you like) and you're all set. You can skip backing up the files in the gallerydata/cache directory if you want, but you'll need the directory structure when you restore it.

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Tue, 2004-08-03 01:51

Actually, I was thinking about writing something more elaborate than "tar up the directory and dump the database" for quite some time. The 'use case' is when you want to move one or several albums from one server to another. You want to make it user-friendly for administrator to backup and restore the albums. Current Gallery1 option limits you to backing up the whole gallery, which makes it very difficult (if not impossible) to move it to a new server unless you have double the amount of space on the new server.

Obviously, it may be too early to develop such module (or maybe I just need a reason to procrastinate hoping that somebody will do it for me) - but I would hope that esteemed PM will put it on a wish list 8)

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Tue, 2004-08-03 05:02

Yep, it would be nice to have something like that. David, please get that on the list would you? Thanks!

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Thu, 2004-12-02 06:44

Well, here is my attempt at a custom modules - Backup and Restore. It is still "alpha" - it does 50% of what I would like it to do, and 80% of what I really need it to do. It doesn't handle album trees (only individual albums), and it loses some significant metadata like view counts, layouts, highlights... The backup saves the metadata in the 'backup' subdirectory of whatever you specified for your base data directory. In order to do the restore you also need to copy the actual data files to the same directory.

My typical use for it is the following: I import albums from G1 to G2 on my production machine (which doesn't have much space left); then back up metadata, copy metadata and albums to development box and restore into G2...

In short, it is far from 'prime time'. However, before I carry on with my perhaps flawed design decisions, I'd appreciate some feedback from the development team... I put plenty of comments in the code, including missing blocks (TODO) and some design choices that still need to be made (eg., how to handle permissions)

Thanks in advance.

AttachmentSize
backup.zip27.17 KB