Hi All,
I am new to this SQL stuff..
Could someone please enlighten me on how reliable this thing is?
I mean, in G1 I could just back up the _albums_ directory and move it to another server - the almums/database were easily backupable/moveable.
Now, I know how to back it up in principle (my web-host allows to download/upload it) but what happens if I move to some other hosting company? I guess, if the new server runs the MySQL - there shouldn't be any prob. But what if they have another database implementation? Or if in a few years MySQL goes to version 23 - will they be compatible with my backups?
Any comments on this would be appreciated greatly.
TIA
max
Posts: 32509
FAQ: How can I move my gallery installation from one server to another?
backing up g2 = backup the db and the g2data folder.
right, you can only move from mysql to mysql.
your photos and albums are still stored in g2data/albums, only metadata (users, titles, ...) are stored in the db.
Posts: 3
Thanks!
BTW, what is the right way to back up the g2data folder? I tried to tar it from the server side - it gave me a bunch of errors saying that a lot of files (most of them in the _cach_ directory failed to go to the archive..
Posts: 32509
tar always worked for me
tar -czf g2data.tar.gz g2data
Posts: 10
Actually the files in the g2data directory are all owned by the web-server. Some of them (g2data/cache/derivative/*/*/*.dat) are protected 600, so these can't be read by anyone else but the webserver identity! I have a script that uses rsync to automatically backup all changes to my gallery (and other parts of my website) every night. With G2 that script fails on these files. Are these files not essential, can they be skipped, or should I raise a bug-report on this?
Posts: 32509
first things first:
it's certainly not a bug because g2 still works as expected. just because your script doesn't work, it's not a bug.
about your script / problem:
you could use a php script to generate a tar ball, e.g.
<?php system('tar -czf /path/to/backupDir/g2data.tar.gz /path/to/g2data/'); ?>
which creates a backup with the webserver user. such a script can be called with cron too, e.g. in a password protected dir. "wget http://user:password@host.com/_924bsD92/backup.php"
my webhost offers a cpanel backup solution.
users who have their own server can do more advanced / easier stuff.
Posts: 16504
You might also want to look at setting the permissions G2 sets on files it creates so you can read them as well. For instance 755 for directories and 644 for files. That's in the Site Admin > General section.
Posts: 10
Great! Thanks! Although when I look at the General page in the Admin view, the default settings are already 755 for directories and 644 for files. Despite this, some files are created 600 as I mentioned in my previous posting. So it looks like I will have to create that php-script to make the tar-file as the web-user identity. (But I still don't understand why it is necessary for Gallery 2 to create these files with 600).
//hgpuke
Posts: 3236
It could be that your host is forcing this and that gallery actually has no control. I'm pretty sure that all of my G2 files are created with the perms specified in G2's configuration.
Signature: Like Gallery? Appreciate my help? Think I'm an asshole? Make your point by donating to the Gallery project! Or maybe just visit my website.