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 3 4 5 6   Go Down

Author Topic: Backup: backup and restore the database  (Read 195508 times)

0 Members and 1 Guest are viewing this topic.

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Backup: backup and restore the database
« on: January 21, 2007, 03:04:39 pm »

Backup and restore de database

based on the XT Dump script with the agreement of the author
Use it carrefully. For the first use, make a backup with another tool like phpmyadmin in case of problem.
I've tested on my server and it works, but if a developper can have a look it will be better  ;)
I hope this plugin can help people who are searching a backup way without using external  tools like phpmyadmin.

What it is


This plugin is a simple way for backup and restore the Coppermine database directly from the admin menu:
there are three actions possible:
*Backup the database. The plugin will create a database dump in the /dumps/ folder on your server. You have the possibility to dowload the file on your computer
*Restore the database. The plugin restore the database from the dump on your server. 
*Managing the dump files on your server. You can download files on your local computer or delete old dump files from your server.

INSTALL


* Unpack the archive and upload the "backup" directory structure to your Coppermine
  gallery's plugins folder.
* Login as an admin, go to config, then "Manage Plugins"
* Find the backup entry in the available plugins and click install.
* When logged in as admin you will have a new admin menu button (backup/restore) to launch the process

USE


*Backup:  The plugin create a dump from your database in the /plugins/backup/dumps/ folder on your coppermine install (server)
          You can dowload the file on your computer (local) by clicking the button on end of the process
*Restore: The plugin restores your database with the dump file you choose in the dropdown list (all dump files in the /dumps/ folder)
          if you wish to use a backup file which is not present on your server, it will have to be placed in the backup plugin /dumps/folder  using the ftp
*Managing dump files:With this option you can manage the dump files in your backup plugin /dumps/ folder.
          You can dowload the files on your local installation or delete old files

Modifications
*Little correction in the gest.php file (thank's Hein for report)
*New 2.3 version (by Joachim Müller)       
LANGUAGE


The plugin comes with english and french language files
Italian translation added (thank's Angeldevil)
Dutch translation added (thank's Hein)
German translation added (thank's AlexL)
Persian
Croatian
« Last Edit: January 30, 2008, 07:45:37 am by Frantz »
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

angeldevil

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 107
Re: Backup: backup and restore the database (experimental)
« Reply #1 on: January 21, 2007, 07:40:29 pm »

Hi Frantz, great job!

... my Italian language translation in attached file
« Last Edit: January 24, 2007, 04:27:09 pm by angeldevil »
Logged
a

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #2 on: January 21, 2007, 08:12:48 pm »

Hi Angeldevil,

Thank's for your contribution.
I add your file in the pack
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Backup: backup and restore the database (experimental)
« Reply #3 on: January 30, 2007, 02:41:36 pm »

Nice work Frantz!

Dutch.php added to this post.

Kind regards,
Hein
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #4 on: January 31, 2007, 07:01:18 am »

Thank's Hein,

your lang file is added in the pack in the first post
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Backup: backup and restore the database (experimental)
« Reply #5 on: February 06, 2007, 12:08:51 pm »

Frantz,

tested it on my work-in-progress CPG (the one with the large list of plugins  ;D) and it works.
Just one note to make and that is that it is nescesary the dumps folder to 777 so the script can
write the backup file into that folder.

One other things is that when i go to the manage part of the dump files i see the list of dumps i made and a word behind, it says Supprimer. I assume it says delete in some language. It is hardcoded into gest.php with no reference to a language file tag.

Regards,
Hein
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #6 on: February 06, 2007, 01:22:02 pm »

Quote
One other things is that when i go to the manage part of the dump files i see the list of dumps i made and a word behind, it says Supprimer. I assume it says delete in some language. It is hardcoded into gest.php with no reference to a language file tag.
oups! i have forgotten to change this  :-[
will do this asp.

Thank's for report this
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

bloodykiss

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 1
    • HIM french website
Re: Backup: backup and restore the database (experimental)
« Reply #7 on: February 14, 2007, 07:55:59 am »

Hello there !

Firstable, thanx for the plugin you made, I think it can be really usefull !

I have a problem... Here is what it says :

Template error
Failed to find block 'documentation'(#(<!-- BEGIN documentation -->)(.*?)(<!-- END documentation -->)#s) in :

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
                                <td class="admin_menu"><a href="editpics.php?mode=upload_approval" title="">{UPL_APP_LNK}</a></td>
                                <td class="admin_menu"><a href="config.php" title="">{CONFIG_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="db_ecard.php" title="">{DB_ECARD_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="">{COMMENTS_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="">{MY_PROF_LNK}</a></td>
                        </tr>
                </table>
                </div>

Can you help me ?
I didn't save the backup 'cause I didn't know how to do it (that's why i installed your plugin)...
I hope it's not a too big problem.

Thank you !!!
Logged

AlexL

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 189
    • Velvet Photos
Re: Backup: backup and restore the database (experimental)
« Reply #8 on: February 14, 2007, 03:46:16 pm »

Hello Frantz

German Lang File for your DB-Backup

LG
AlexL

(For files look to later post)
« Last Edit: March 22, 2007, 02:32:23 pm by AlexL »
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #9 on: February 14, 2007, 08:34:43 pm »

@ AlexL, Thank's, your file will be added in the pack

@bloodykiss,
what theme do you have on your gallery ?
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Backup: backup and restore the database (experimental)
« Reply #10 on: March 09, 2007, 04:35:41 pm »

Frantz,

not sure if i need to post this here or at Stramm's mod pack but i have his modpak installed on my private CPG with the Oranje theme. When i run the backup plugin you made it only goes halfway and then says only the word error.

Code: [Select]
USER:
------------------
Array
(
    [ID] => d6d317e8ccae72da826b565b89013be4
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 518
            [1] => 517
            [2] => 521
            [3] => 7
            [4] => 10
        )

    [sort] => da
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => Hein
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 1
    [ufc_min] => 1
    [custom_user_upload] => 0
    [num_file_upload] => 10
    [num_URI_upload] => 0
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 1
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg1410_filetypes; (0s)
    [1] => select * from cpg1410_plugins order by priority asc; (0s)
    [2] => delete from `*******`.cpg1410_sessions where time<1173450536 and remember=0; (0.002s)
    [3] => delete from `*******`.cpg1410_sessions where time<1172244536; (0s)
    [4] => select user_id from `*******`.cpg1410_sessions where session_id=md5("d2e7e3bed121f70f8aae2d495f845d7a1c469836f9164ac982aad2272b5d9de8"); (0s)
    [5] => select user_id as id, user_password as password from `*******`.cpg1410_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.avatar_url AS avatar_url, u.enable_admin_email AS notify, u.auto_subscribe_post AS auto_subscribe_post, u.auto_subscribe_comment AS auto_subscribe_comment, u.user_group+100 AS group_id FROM `*******`.cpg1410_users AS u INNER JOIN `*******`.cpg1410_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `*******`.cpg1410_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg1410_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg1410_usergroups WHERE group_id= 1 (0s)
    [10] => update `*******`.cpg1410_sessions set time='1173454136' where session_id=md5('d2e7e3bed121f70f8aae2d495f845d7a1c469836f9164ac982aad2272b5d9de8'); (0s)
    [11] => SELECT user_favpics FROM cpg1410_favpics WHERE user_id = 1 (0.001s)
    [12] => SELECT home,login,my_gallery,upload_pic,album_list,lastup,lastcom,topn,toprated,favpics,search FROM cpg1410_final_extract_config WHERE Group_Id=1 (0s)
    [13] => SHOW TABLES LIKE 'cpg1410_cms_config' (0.002s)
    [14] => SELECT * FROM cpg1410_cms_config (0s)
    [15] => SELECT count(*) FROM  cpg1410_pms WHERE owner=1 (0.001s)
    [16] => SELECT count(*) FROM  cpg1410_pms WHERE owner=1 AND showed='0' (0s)
    [17] => SELECT count(*) FROM  cpg1410_buddy WHERE user_id=1 (0s)
    [18] => SELECT count(*) FROM  cpg1410_buddy_req WHERE buddy_to=1 (0s)
    [19] => DELETE FROM cpg1410_banned WHERE expiry < '2007-03-09 15:28:56' (0s)
    [20] => SELECT * FROM cpg1410_banned WHERE (ip_addr='81.69.50.110' OR ip_addr='81.69.50.110' OR user_id=1) AND brute_force=0 (0s)
)

==========================
GET :
------------------
Array
(
    [file] => backup/backup
)

==========================
POST :
------------------
Array
(
    [act] => dodump
    [dbhost] => localhost
    [dbbase] => *******
    [dbuser] => *******
    [dbpass] => **********
    [LastTable] => -1
    [LastRow] => -1
    [selc] => on
    [tbls] => Array
        (
            [0] => cpg1410_albums
            [1] => cpg1410_banned
            [2] => cpg1410_bridge
            [3] => cpg1410_buddy
            [4] => cpg1410_buddy_req
            [5] => cpg1410_categories
            [6] => cpg1410_cms
            [7] => cpg1410_cms_config
            [8] => cpg1410_comments
            [9] => cpg1410_config
            [10] => cpg1410_dict
            [11] => cpg1410_ecards
            [12] => cpg1410_exif
            [13] => cpg1410_favpics
            [14] => cpg1410_filetypes
            [15] => cpg1410_final_extract_config
            [16] => cpg1410_hit_stats
            [17] => cpg1410_notify
            [18] => cpg1410_pictures
            [19] => cpg1410_plugins
            [20] => cpg1410_pms
            [21] => cpg1410_sessions
            [22] => cpg1410_temp_data
            [23] => cpg1410_usergroups
            [24] => cpg1410_users
            [25] => cpg1410_vote_stats
            [26] => cpg1410_votes
        )

    [SaveStruct] => 1
    [SaveData] => 1
    [ChkDropTable] => 1
    [ChckIfNotExists] => 1
    [FileName] => dump_*******_20070309
)

==========================
VERSION INFO :
------------------
PHP version: 5.1.6-pl6-gentoo - OK
------------------
mySQL version: 4.1.21-log
------------------
Coppermine version: 1.4.10 modpack v1(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XPM Support:
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 5
Active Links 6
Client API version 4.1.21
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib64 -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/share/php5:/usr/share/php | .:/usr/share/php5:/usr/share/php
open_basedir | /kill-9.be/users/hop:/tmp/:/usr/share/php/:/usr/lib/php/ | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 4M | 4M
post_max_size | 8M | 8M
==========================
Page generated in 0.13 seconds - 21 queries in 0.006 seconds - Album set : ; Meta set: ;

Not really a disaster but if you know how to solve it might be usefull to others who use Stramm's modpack combined with your DB backup plugin.

Cheers
Hein
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #11 on: March 10, 2007, 09:31:40 am »

Hein,

I d'ont use the stramm mod pack. I really don't know hauw to find why this error comes...
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Backup: backup and restore the database (experimental)
« Reply #12 on: March 11, 2007, 03:47:29 pm »

:) was worth a shot.
Logged

AlexL

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 189
    • Velvet Photos
Re: Backup: backup and restore the database (experimental)
« Reply #13 on: March 22, 2007, 02:41:33 pm »

Hello Frantz

now - after my first use the backup PlugIn - I have minor corrections for the german.php - see attached.
Furthermore I have translated the README to a german liesmich.txt and completed this and the Readme with the chmod777 tip

And a little bug the "Return to backup menu" button dosn't work
And if you are looking for a little job ;) change the suggested filename from the DB-Dump-File
from dump_%username%sql2_%date%.sql to dump_sql2_%date%_%time%.sql.           
Because of I know my username - but I make more than one dump a day when I make modifications.

Greetings
AlexL
« Last Edit: March 22, 2007, 07:27:28 pm by AlexL »
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #14 on: March 22, 2007, 07:54:40 pm »

Thank's AlexL, will add your contribution in the pack asp
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

su_ict

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Backup: backup and restore the database (experimental)
« Reply #15 on: June 12, 2007, 11:27:13 am »

Installed - tested and works like a charm ! AFAIK the experimental can be removed  8)

Hein (Dutch transl) : the button in the first screen of this mod states "connect" as title - maybe change it to "uitvoeren" oid in the dutch language file ?!?
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Backup: backup and restore the database (experimental)
« Reply #16 on: June 12, 2007, 11:42:04 am »

Installed - tested and works like a charm ! AFAIK the experimental can be removed  8)

Hein (Dutch transl) : the button in the first screen of this mod states "connect" as title - maybe change it to "uitvoeren" oid in the dutch language file ?!?

I agree on removing the experimental tag.
I updated the dutch.php a bit and added it to this post.

Hein
Logged

su_ict

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Backup: backup and restore the database (experimental)
« Reply #17 on: June 12, 2007, 02:00:22 pm »

I updated the dutch.php a bit and added it to this post.

Hein

Thx Hein - active as we speek  :o 8)
Logged

superdave

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Backup: backup and restore the database (experimental)
« Reply #18 on: June 12, 2007, 08:30:51 pm »

definitely not experimental ... i just installed it and backed up my database, no problems!!!  :)  :D

i hope you don't mind, but in the backup menu, you should make a small correction:

Quote
Click for select all teh tables

change to

Quote
Click to select all tables

GREAT PLUGIN!!
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Backup: backup and restore the database (experimental)
« Reply #19 on: June 13, 2007, 07:44:29 am »

Quote
definitely not experimental ... i just installed it and backed up my database, no problems!!!  Sourire  Souriant
I'm happy for you  ;)
Thank's for reporting the typo in the langage file. I'll change it asp.
@ HEIN I'll update the pack asp with your new dutch lang file.
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog
Pages: [1] 2 3 4 5 6   Go Up
 

Page created in 0.031 seconds with 21 queries.