Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: [help wanted]:MySQL backup system  (Read 29802 times)

0 Members and 1 Guest are viewing this topic.

nova

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
[help wanted]:MySQL backup system
« on: October 21, 2003, 03:32:47 pm »

I would join Laugesen in his request for a backup/restore function. It would be nice, not to have to use the phpMyAdmin part. In my oppinion the function should create a single file you could download (or ftp) to your HD and/or your CD-writer.

If your database goes down the drain, there should be a restore function. I know that there can be some glitches if you have a working database with dublet entries, but the starting point should be a "clean" mySQL database, so you don't have to think about that.

It sounds simple, but I'm not a php expert, so I turn to this forum. :-)

Yours sincerly

Rasmus
« Last Edit: January 22, 2007, 10:12:58 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[help wanted]:MySQL backup system
« Reply #1 on: October 21, 2003, 06:22:36 pm »

let's make some kind of "quest" out of this: phpMyAdmin is open source released under GNU GPL as well as Coppermine; I have seen other free software using the phpMyAdmin function inside their software (for example phpBB or some typo3 backup modules).
It'd be a nice opportunity for some coder who'd like to contribute to coppermine to code this into a standalone piece of code (one file), taking into account to Coppermine structure, build some front-end bits and voila - we have a backup routine.
Who'd like to try and take the "quest" (and get all the "fame"; sorry, no "money" or "girls" come with this :wink: )?

GauGau
Logged

Laugesen

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Posts: 45
    • http://www.tommerup.net
[help wanted]:MySQL backup system
« Reply #2 on: October 21, 2003, 06:31:29 pm »

My idea was not to use a whole PHPMySQL system, I know that, but a simple way to save all coppermine related MySQL data in a file, stored local on pc.

And in the Install process, a function like a choice to use the xx.sql files in the reinstall

Hopefully to make it simple, not complicated like phpMYSQL is for "noobs"
Logged
***** Jan Ole Laugesen *****
         Wissen ist macht...
Ich weiß nicht und macht nicht...

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[help wanted]:MySQL backup system
« Reply #3 on: October 21, 2003, 06:37:02 pm »

yeah, I know that - the coder has to use some of phpMyAdmin functions, but his mod has to do two things (or buttons):
- backup the complete Coppermine gallery mySQL data
- restore it from a previous backup

To get an idea, check phpBB documentation: backup

GauGau
Logged

azrael

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
[help wanted]:MySQL backup system
« Reply #4 on: October 23, 2003, 01:24:24 pm »

Might be a bit outside the meaning of the thread but just adding my
2 cents of worth into the discussion.
Isnt system backup something which should be outside the application?
Although it is a nice thing to integrate, it is sometimes the best thing to
keep an application for what it is and not try to integrate every know
feature known to man into it, since result often will be a bloated code and
a slow application.

Personally i wrote shell scripts for backing up the 30 or so mysql bases
i got running that i put into the cron.daily folder.
Basics is that i run mysqldump on the bases, take the output, tars and
gunzips it and gives it a filenane with todays name in and puts it in a
backupdir, runs daily and seamless in the background each night.
If you do regular backups of your server to tape, files will then be
included for offsite backup too.

If theres any interest to it i can post the scripts here.
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
[help wanted]:MySQL backup system
« Reply #5 on: October 23, 2003, 02:14:41 pm »

I have been thinking about the bloat in CPG code... The first fact is that it is inevitable BUT the question is do we need to encumber everyone with the entire code?

I propose a system of modules / plugins - the API of which should be such that if the module files are placed within a directory of their own within the modules folder the Config / admin menu on top should be able to link to it directly and automagically.

I guess the back-up can be one such utility. The themes already work on this principal - BUT - that is being simplistic.
Logged
SANIsoft PHP applications for E Biz

Laugesen

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Posts: 45
    • http://www.tommerup.net
[help wanted]:MySQL backup system
« Reply #6 on: October 23, 2003, 02:22:15 pm »

As a plug-in it would be great, then the users got a choice to DL it and use it or not. :wink:
Logged
***** Jan Ole Laugesen *****
         Wissen ist macht...
Ich weiß nicht und macht nicht...

jasendorf

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 350
    • http://www.338tharmyband.com
[help wanted]:MySQL backup system
« Reply #7 on: October 23, 2003, 04:03:32 pm »

Quote
Isnt system backup something which should be outside the application?


In a utopia where everyone owned their own server and had a shell account, yes... I suppose so.  But, remember, many people are stuck with far less access than that.
Logged
Read the Online DOCs,FAQ, and SEARCH the board BEFORE posting questions for help.

azrael

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
[help wanted]:MySQL backup system
« Reply #8 on: October 23, 2003, 05:21:57 pm »

Ok, guess i am a bit spoiled accesswise having root access to the
production servers.
Although, the module idea that was proposed sounds like a rather good
idea, since everyone stands a bit freer to install what parts of the
application they can use. I can have my stripped down core version of
coppermine, small and optimized for speed due to heavy load, other
people get all the nice features they want.

Customizing would be easier in a set standard, and installation of named
plugins would hopefully go easier.
Hope you will follow this path.

--
Az.
Logged

nova

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
[help wanted]:MySQL backup system
« Reply #9 on: October 23, 2003, 06:39:53 pm »

A plugin you could download and use (just like the templates and/or the languages) sounds like a really good solution. In that way you don't have to make the 'core' of Coppermine bigger or more complicated.

Yours sincerly

Rasmus
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[help wanted]:MySQL backup system
« Reply #10 on: October 23, 2003, 11:04:06 pm »

I agree that we don't have to add each and every feature one could think of into the core - the module idea seems to be tempting. But I've seen other projects trying this and fail...
An application like coppermine is mainly for those who actually can't code (non-geeks), because that's what they can do: put pics on their site to have some content after all.
Especially a backup of coppermine could be done in a separate file (only one more link in the admin menu) with just the look of coppermine - no big deal... Call it a module or whatever.
There are other parts of coppermine I'd like to drop (making them add-ons that can be downloaded and added separately): there are already to many themes  in the package, and way to many languages to maintain.

GauGau
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
[help wanted]:MySQL backup system
« Reply #11 on: October 24, 2003, 05:58:11 am »

The idea of module is also tempting for me because as I see it the lang arrays associated with that module will be in that module directory and not clutter the lang files of the core application also an API will be provided so that the module can default to english if the selected lang is not available

Right now I envisage just two category of modules
1) Those which integrate with the main admin (top menu) like Resize and Backup
2) Those which integrate with the image editing like edit description, crop and rotate image, add multimedia etc (will appear as drop-down below image in admin mode)

We can also have guidelines for designing modules and self imposed rating of difficulty of integration, though ideally a module should never require to edit a core CPG file
Logged
SANIsoft PHP applications for E Biz

Oxy

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
[help wanted]:MySQL backup system
« Reply #12 on: November 30, 2003, 07:17:23 am »

I just have a question for those who are hosted with few rights or others who know the situation.
Do you have right to remotely execute sqldump ?
I mean, do most host allow that or not ?

Because even without getting a shell access maybe the function is available. I activated a free account on a public host but I could only try later they need 24h to activate my DB access (cron task :( ) so maybe some of you have the answer right now and it is always good to have several feedback.


ps: Is someone working on that ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[help wanted]:MySQL backup system
« Reply #13 on: November 30, 2003, 08:11:13 am »

I doubt that there's a workaround if you don't have shell access.

GauGau
Logged

Oxy

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
[help wanted]:MySQL backup system
« Reply #14 on: November 30, 2003, 03:45:19 pm »

??????
If you do not have shell access this is not preventing you from executing the imagemagick converter tool for example so if servers propose access to sqldump why not : exec "/usr/bin/sqldump" .. ?
Logged

jason

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 78
backup and restore sql database
« Reply #15 on: December 31, 2003, 05:06:03 pm »

backup (mysqldump)

Code: [Select]
#!/usr/bin/perl
open(STDERR, ">&STDOUT");
$|=1;
print "Content-type: text/html\n\n";
print "<pre>\n";
$t = `date`;
print "$t\n\n";
system("mysqldump -u USERNAME -pPASSWORD --opt DATABSE_NAME > /path/to/database.sql");
$t = `date`;
print "\n\n$t";
print "</pre>";


restore (mysql)

Code: [Select]
#!/usr/bin/perl
open(STDERR, ">&STDOUT");
$|=1;
print "Content-type: text/html\n\n";
print "<pre>\n";
$t = `date`;
print "$t\n\n";
system("mysql -u USERNAME -pPASSWORD DATABASE_NAME < /path/to/database.sql");
$t = `date`;
print "\n\n$t";
print "</pre>";


place perl scripts inside your cgi-bin directory and call them from your web browser, no need to split or have shell access.  delete perl scripts and database file from your site when you are done.

you could take this further by compressing the file and setup a date archival format that could be utilized from cron jobs.

mysql backup restore split chunks large database cron
Logged
jason

daniel.duarte

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
cron jobs for backup of database
« Reply #16 on: January 10, 2004, 01:12:44 pm »

Quote from: "azrael"
If theres any interest to it i can post the scripts here.


Hello,

I've been using phpMyAdmin to do regular backups of the db to a file in the coppermine directory, and then I simply do regular backups of all the directory.

However I wanted to automate this process, and the idea of a daily cron job to backup is very tempting.

Could you please post the scripts, and some insctrutions? And restoring the backup, can be done with phpmyadmin?

Thanks!
Logged

jason

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 78
[help wanted]:MySQL backup system
« Reply #17 on: January 13, 2004, 03:17:42 am »

look up.

other than adding in a simple recursive copy command for your cpg files, what else are you looking for?
Logged
jason

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[help wanted]:MySQL backup system
« Reply #18 on: January 13, 2004, 04:37:20 am »

those in the know don't have need for a built-in backup....
Coppermine is being used by a lot of beginners who simply don't know how to use such a command. What we're looking for is an integration into the user interface of coppermine (similar to the backup function of phpBB) that has two buttons: "backup coppermine database" and "restore coppermine database" with some bells and whirrs starting when someone is about to restore the database (alerting him that all db content will be replaced with the stuff from the backup).

GauGau
Logged

jason

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 78
[help wanted]:MySQL backup system
« Reply #19 on: January 13, 2004, 02:19:02 pm »

gaugau, the problem with integrating a backup/restore from a php page is it get's restricted by the php upload limitations.  while this only affects restores, it still hinders a "cute and simple" solution that other php based projects (like phpBB) have attempted (without splitting into chunks, who wants to do that!)

i supposed if the php backup/restore page created a local file on the webserver instead of downloading through the browser and then allowing the user to pick and choose which backup to restore from list of backups made....then it would work fine.

i *think* i can set this up.
Logged
jason
Pages: [1] 2   Go Up
 

Page created in 0.025 seconds with 20 queries.