Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

backup advice wanted

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


jimhu at tamu

Jun 12, 2008, 11:51 PM

Post #1 of 12 (2833 views)
Permalink
backup advice wanted

Hi all,

Having learned the hard way that just doing Retrospect filesystem
backups does not always work on the database... I'm looking for advice
on how to do backups for our public wikis to minimize downtime when
we're doing server maintenance.

I've looked at the docs at:

http://www.mediawiki.org/wiki/Backup

and I'm still a bit confused. Assuming that I'll be using mysqldump...
do I need to take the wiki offline during the dump process (the
discussion of mysqldump vs mysqlhotcopy seems to be inconsistent with
what's at the mysql.com website wrt using hotcopy with InnoDB
tables)? Are there any tips people can share?

This came up during a migration of /usr/local/mysql and the apache
root directory to a new set of disks. I had backed everything up to
another set of disks (actually this was temporarily using our dev
server as a firewire drive). I pointed usr/local and apache root to
the backups in the hope that I could keep the wikis online while we
replaced the main disks on the production server. The plan was to keep
this running while we set up the new disks and then copy data back to
the new disks, change the symlinks for /usr/local etc to the new
places, and restart mysql and apache. While this is going on, I've
disabled editing on the backup copy, but users should be able to view/
browse/search. But mysql was very unhappy and wouldn't run from the
backups. I ended up deleting all of the files from the backup copy of
the mysql data directory and rebuilding all the databases in the
backup from an SQL dump, with apache turned off for several hours.

I feel like there has to be a better way, even with our small operation.

Thanks!

Jim

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


ChristensenC at BATTELLE

Jun 23, 2008, 7:25 AM

Post #2 of 12 (2685 views)
Permalink
Re: backup advice wanted [In reply to]

Hi Jim,

We routinely use mysqldump on live wikis. The only consideration is,
"Is content likely to change while the dump is happening?" So you could
lock the wiki for editing while you dump if you want. Our largest wikis
seem to take 30 minutes to dump at most. But then our largest aren't
very large, about ten thousand pages.

Does that help?
-Courtney

PS. Don't forget to back up your uploads.



-----Original Message-----
From: mediawiki-l-bounces [at] lists
[mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
Sent: Friday, June 13, 2008 2:51 AM
To: MediaWiki announcements and site admin list
Subject: [Mediawiki-l] backup advice wanted

Hi all,

Having learned the hard way that just doing Retrospect filesystem
backups does not always work on the database... I'm looking for advice
on how to do backups for our public wikis to minimize downtime when
we're doing server maintenance.

I've looked at the docs at:

http://www.mediawiki.org/wiki/Backup

and I'm still a bit confused. Assuming that I'll be using mysqldump...
do I need to take the wiki offline during the dump process (the
discussion of mysqldump vs mysqlhotcopy seems to be inconsistent with
what's at the mysql.com website wrt using hotcopy with InnoDB
tables)? Are there any tips people can share?

This came up during a migration of /usr/local/mysql and the apache
root directory to a new set of disks. I had backed everything up to
another set of disks (actually this was temporarily using our dev
server as a firewire drive). I pointed usr/local and apache root to
the backups in the hope that I could keep the wikis online while we
replaced the main disks on the production server. The plan was to keep
this running while we set up the new disks and then copy data back to
the new disks, change the symlinks for /usr/local etc to the new
places, and restart mysql and apache. While this is going on, I've
disabled editing on the backup copy, but users should be able to view/
browse/search. But mysql was very unhappy and wouldn't run from the
backups. I ended up deleting all of the files from the backup copy of
the mysql data directory and rebuilding all the databases in the
backup from an SQL dump, with apache turned off for several hours.

I feel like there has to be a better way, even with our small operation.

Thanks!

Jim

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


jimhu at tamu

Jun 23, 2008, 8:25 AM

Post #3 of 12 (2685 views)
Permalink
Re: backup advice wanted [In reply to]

Thanks. Good to know that this works.

Even though our largest are quite a bit bigger, I decided that this
would work, esp. if we do it at 1AM. I modified a shell script that
Dan Bolser sent me off-list and we're now doing it daily where the
filename includes the day of the week so we have a rotating set going
back one week. These get backed up via the regular file backup so we
should be able to go back further.

Jim

On Jun 23, 2008, at 9:25 AM, Christensen, Courtney wrote:

> Hi Jim,
>
> We routinely use mysqldump on live wikis. The only consideration is,
> "Is content likely to change while the dump is happening?" So you
> could
> lock the wiki for editing while you dump if you want. Our largest
> wikis
> seem to take 30 minutes to dump at most. But then our largest aren't
> very large, about ten thousand pages.
>
> Does that help?
> -Courtney
>
> PS. Don't forget to back up your uploads.
>
>
>
> -----Original Message-----
> From: mediawiki-l-bounces [at] lists
> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
> Sent: Friday, June 13, 2008 2:51 AM
> To: MediaWiki announcements and site admin list
> Subject: [Mediawiki-l] backup advice wanted
>
> Hi all,
>
> Having learned the hard way that just doing Retrospect filesystem
> backups does not always work on the database... I'm looking for advice
> on how to do backups for our public wikis to minimize downtime when
> we're doing server maintenance.
>
> I've looked at the docs at:
>
> http://www.mediawiki.org/wiki/Backup
>
> and I'm still a bit confused. Assuming that I'll be using mysqldump...
> do I need to take the wiki offline during the dump process (the
> discussion of mysqldump vs mysqlhotcopy seems to be inconsistent with
> what's at the mysql.com website wrt using hotcopy with InnoDB
> tables)? Are there any tips people can share?
>
> This came up during a migration of /usr/local/mysql and the apache
> root directory to a new set of disks. I had backed everything up to
> another set of disks (actually this was temporarily using our dev
> server as a firewire drive). I pointed usr/local and apache root to
> the backups in the hope that I could keep the wikis online while we
> replaced the main disks on the production server. The plan was to keep
> this running while we set up the new disks and then copy data back to
> the new disks, change the symlinks for /usr/local etc to the new
> places, and restart mysql and apache. While this is going on, I've
> disabled editing on the backup copy, but users should be able to view/
> browse/search. But mysql was very unhappy and wouldn't run from the
> backups. I ended up deleting all of the files from the backup copy of
> the mysql data directory and rebuilding all the databases in the
> backup from an SQL dump, with apache turned off for several hours.
>
> I feel like there has to be a better way, even with our small
> operation.
>
> Thanks!
>
> Jim
>
> =====================================
> Jim Hu
> Associate Professor
> Dept. of Biochemistry and Biophysics
> 2128 TAMU
> Texas A&M Univ.
> College Station, TX 77843-2128
> 979-862-4054
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


sethile.pipes at gmail

Jun 23, 2008, 9:27 AM

Post #4 of 12 (2688 views)
Permalink
Re: backup advice wanted [In reply to]

This sounds like a good backup solution for my situation too.

Dan, any chance I can get a copy of your modified shell script? If so, my
address is:
mailto:sethile.pipes [at] gmail

Hopefully I can figure out how to modify and implement it for our situation
too.

Thanks, Scott

> -----Original Message-----
> From: mediawiki-l-bounces [at] lists
> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
> Sent: Monday, June 23, 2008 10:26 AM
> To: MediaWiki announcements and site admin list
> Subject: Re: [Mediawiki-l] backup advice wanted
>
>
> Thanks. Good to know that this works.
>
> Even though our largest are quite a bit bigger, I decided that this
> would work, esp. if we do it at 1AM. I modified a shell script that
> Dan Bolser sent me off-list and we're now doing it daily where the
> filename includes the day of the week so we have a rotating
> set going
> back one week. These get backed up via the regular file
> backup so we
> should be able to go back further.
>
> Jim
>
> On Jun 23, 2008, at 9:25 AM, Christensen, Courtney wrote:
>
> > Hi Jim,
> >
> > We routinely use mysqldump on live wikis. The only
> consideration is,
> > "Is content likely to change while the dump is happening?" So you
> > could
> > lock the wiki for editing while you dump if you want. Our largest
> > wikis
> > seem to take 30 minutes to dump at most. But then our
> largest aren't
> > very large, about ten thousand pages.
> >
> > Does that help?
> > -Courtney
> >
> > PS. Don't forget to back up your uploads.
> >
> >
> >
> > -----Original Message-----
> > From: mediawiki-l-bounces [at] lists
> > [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
> > Sent: Friday, June 13, 2008 2:51 AM
> > To: MediaWiki announcements and site admin list
> > Subject: [Mediawiki-l] backup advice wanted
> >
> > Hi all,
> >
> > Having learned the hard way that just doing Retrospect filesystem
> > backups does not always work on the database... I'm looking
> for advice
> > on how to do backups for our public wikis to minimize downtime when
> > we're doing server maintenance.
> >
> > I've looked at the docs at:
> >
> > http://www.mediawiki.org/wiki/Backup
> >
> > and I'm still a bit confused. Assuming that I'll be using
> mysqldump...
> > do I need to take the wiki offline during the dump process (the
> > discussion of mysqldump vs mysqlhotcopy seems to be
> inconsistent with
> > what's at the mysql.com website wrt using hotcopy with
> InnoDB tables)?
> > Are there any tips people can share?
> >
> > This came up during a migration of /usr/local/mysql and the apache
> > root directory to a new set of disks. I had backed
> everything up to
> > another set of disks (actually this was temporarily using our dev
> > server as a firewire drive). I pointed usr/local and
> apache root to
> > the backups in the hope that I could keep the wikis online while we
> > replaced the main disks on the production server. The plan
> was to keep
> > this running while we set up the new disks and then copy
> data back to
> > the new disks, change the symlinks for /usr/local etc to the new
> > places, and restart mysql and apache. While this is going on, I've
> > disabled editing on the backup copy, but users should be
> able to view/
> > browse/search. But mysql was very unhappy and wouldn't
> run from the
> > backups. I ended up deleting all of the files from the
> backup copy of
> > the mysql data directory and rebuilding all the databases in the
> > backup from an SQL dump, with apache turned off for several hours.
> >
> > I feel like there has to be a better way, even with our small
> > operation.
> >
> > Thanks!
> >
> > Jim
> >
> > =====================================
> > Jim Hu
> > Associate Professor
> > Dept. of Biochemistry and Biophysics
> > 2128 TAMU
> > Texas A&M Univ.
> > College Station, TX 77843-2128
> > 979-862-4054
> >
> >
> > _______________________________________________
> > MediaWiki-l mailing list
> > MediaWiki-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >
> > _______________________________________________
> > MediaWiki-l mailing list
> > MediaWiki-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
> =====================================
> Jim Hu
> Associate Professor
> Dept. of Biochemistry and Biophysics
> 2128 TAMU
> Texas A&M Univ.
> College Station, TX 77843-2128
> 979-862-4054
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


admin at dkosopedia

Jun 23, 2008, 11:43 AM

Post #5 of 12 (2689 views)
Permalink
Re: backup advice wanted [In reply to]

I too would like a copy of this shell script.

thanks


On Jun 23, 2008, at 12:27 PM, Scott Thile wrote:

> This sounds like a good backup solution for my situation too.
>
> Dan, any chance I can get a copy of your modified shell script? If
> so, my
> address is:
> mailto:sethile.pipes [at] gmail
>
> Hopefully I can figure out how to modify and implement it for our
> situation
> too.
>
> Thanks, Scott
>
>> -----Original Message-----
>> From: mediawiki-l-bounces [at] lists
>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
>> Sent: Monday, June 23, 2008 10:26 AM
>> To: MediaWiki announcements and site admin list
>> Subject: Re: [Mediawiki-l] backup advice wanted
>>
>>
>> Thanks. Good to know that this works.
>>
>> Even though our largest are quite a bit bigger, I decided that this
>> would work, esp. if we do it at 1AM. I modified a shell script that
>> Dan Bolser sent me off-list and we're now doing it daily where the
>> filename includes the day of the week so we have a rotating
>> set going
>> back one week. These get backed up via the regular file
>> backup so we
>> should be able to go back further.
>>
>> Jim
>>
>> On Jun 23, 2008, at 9:25 AM, Christensen, Courtney wrote:
>>
>>> Hi Jim,
>>>
>>> We routinely use mysqldump on live wikis. The only
>> consideration is,
>>> "Is content likely to change while the dump is happening?" So you
>>> could
>>> lock the wiki for editing while you dump if you want. Our largest
>>> wikis
>>> seem to take 30 minutes to dump at most. But then our
>> largest aren't
>>> very large, about ten thousand pages.
>>>
>>> Does that help?
>>> -Courtney
>>>
>>> PS. Don't forget to back up your uploads.
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: mediawiki-l-bounces [at] lists
>>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
>>> Sent: Friday, June 13, 2008 2:51 AM
>>> To: MediaWiki announcements and site admin list
>>> Subject: [Mediawiki-l] backup advice wanted
>>>
>>> Hi all,
>>>
>>> Having learned the hard way that just doing Retrospect filesystem
>>> backups does not always work on the database... I'm looking
>> for advice
>>> on how to do backups for our public wikis to minimize downtime when
>>> we're doing server maintenance.
>>>
>>> I've looked at the docs at:
>>>
>>> http://www.mediawiki.org/wiki/Backup
>>>
>>> and I'm still a bit confused. Assuming that I'll be using
>> mysqldump...
>>> do I need to take the wiki offline during the dump process (the
>>> discussion of mysqldump vs mysqlhotcopy seems to be
>> inconsistent with
>>> what's at the mysql.com website wrt using hotcopy with
>> InnoDB tables)?
>>> Are there any tips people can share?
>>>
>>> This came up during a migration of /usr/local/mysql and the apache
>>> root directory to a new set of disks. I had backed
>> everything up to
>>> another set of disks (actually this was temporarily using our dev
>>> server as a firewire drive). I pointed usr/local and
>> apache root to
>>> the backups in the hope that I could keep the wikis online while we
>>> replaced the main disks on the production server. The plan
>> was to keep
>>> this running while we set up the new disks and then copy
>> data back to
>>> the new disks, change the symlinks for /usr/local etc to the new
>>> places, and restart mysql and apache. While this is going on, I've
>>> disabled editing on the backup copy, but users should be
>> able to view/
>>> browse/search. But mysql was very unhappy and wouldn't
>> run from the
>>> backups. I ended up deleting all of the files from the
>> backup copy of
>>> the mysql data directory and rebuilding all the databases in the
>>> backup from an SQL dump, with apache turned off for several hours.
>>>
>>> I feel like there has to be a better way, even with our small
>>> operation.
>>>
>>> Thanks!
>>>
>>> Jim
>>>
>>> =====================================
>>> Jim Hu
>>> Associate Professor
>>> Dept. of Biochemistry and Biophysics
>>> 2128 TAMU
>>> Texas A&M Univ.
>>> College Station, TX 77843-2128
>>> 979-862-4054
>>>
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l [at] lists
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l [at] lists
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
>> =====================================
>> Jim Hu
>> Associate Professor
>> Dept. of Biochemistry and Biophysics
>> 2128 TAMU
>> Texas A&M Univ.
>> College Station, TX 77843-2128
>> 979-862-4054
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l [at] lists
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


jimhu at tamu

Jun 23, 2008, 12:23 PM

Post #6 of 12 (2682 views)
Permalink
Re: backup advice wanted [In reply to]

What the heck, might as well post it to the list; that way others can
suggest improvements! This is my changed version from Dan's

Jim
==============
#!/bin/bash

DBname=<mysql_db_name>
DBuser=<mysql_username>
DBpassword=xxxx

DUMPDIR=/usr/local/sql_dumps # path to where you want the dumps saved

TIMESTAMP=`date +%a`

DUMPFILE=$DBname.Dump.$TIMESTAMP.sql

echo "Dumping $DBname to ... $DUMPFILE"

mysqldump $DBname -u $DBuser -p$DBpassword > $DUMPDIR/$DUMPFILE

echo "Zipping $DUMPFILE to ... $DUMPFILE.gz"

tar -czf $DUMPDIR/$DUMPFILE.tgz $DUMPDIR/$DUMPFILE
==============
Notes:
- I don't think the specification of bash matters.
- replace the obvious values for dbname, user, pass etc.
- the date +%a gives a 3 letter day of the week
- tar is probably overkill, Dan's original used gzip. I had some
problems with that, which I suspect is OSX weirdness. Or just store
it uncompressed.
- when running from cron, I comment out the echos.


On Jun 23, 2008, at 1:43 PM, dKosopedia admin wrote:

> I too would like a copy of this shell script.
>
> thanks
>
>
> On Jun 23, 2008, at 12:27 PM, Scott Thile wrote:
>
>> This sounds like a good backup solution for my situation too.
>>
>> Dan, any chance I can get a copy of your modified shell script? If
>> so, my
>> address is:
>> mailto:sethile.pipes [at] gmail
>>
>> Hopefully I can figure out how to modify and implement it for our
>> situation
>> too.
>>
>> Thanks, Scott
>>
>>> -----Original Message-----
>>> From: mediawiki-l-bounces [at] lists
>>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
>>> Sent: Monday, June 23, 2008 10:26 AM
>>> To: MediaWiki announcements and site admin list
>>> Subject: Re: [Mediawiki-l] backup advice wanted
>>>
>>>
>>> Thanks. Good to know that this works.
>>>
>>> Even though our largest are quite a bit bigger, I decided that this
>>> would work, esp. if we do it at 1AM. I modified a shell script that
>>> Dan Bolser sent me off-list and we're now doing it daily where the
>>> filename includes the day of the week so we have a rotating
>>> set going
>>> back one week. These get backed up via the regular file
>>> backup so we
>>> should be able to go back further.
>>>
>>> Jim
>>>
>>> On Jun 23, 2008, at 9:25 AM, Christensen, Courtney wrote:
>>>
>>>> Hi Jim,
>>>>
>>>> We routinely use mysqldump on live wikis. The only
>>> consideration is,
>>>> "Is content likely to change while the dump is happening?" So you
>>>> could
>>>> lock the wiki for editing while you dump if you want. Our largest
>>>> wikis
>>>> seem to take 30 minutes to dump at most. But then our
>>> largest aren't
>>>> very large, about ten thousand pages.
>>>>
>>>> Does that help?
>>>> -Courtney
>>>>
>>>> PS. Don't forget to back up your uploads.
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: mediawiki-l-bounces [at] lists
>>>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim
>>>> Hu
>>>> Sent: Friday, June 13, 2008 2:51 AM
>>>> To: MediaWiki announcements and site admin list
>>>> Subject: [Mediawiki-l] backup advice wanted
>>>>
>>>> Hi all,
>>>>
>>>> Having learned the hard way that just doing Retrospect filesystem
>>>> backups does not always work on the database... I'm looking
>>> for advice
>>>> on how to do backups for our public wikis to minimize downtime when
>>>> we're doing server maintenance.
>>>>
>>>> I've looked at the docs at:
>>>>
>>>> http://www.mediawiki.org/wiki/Backup
>>>>
>>>> and I'm still a bit confused. Assuming that I'll be using
>>> mysqldump...
>>>> do I need to take the wiki offline during the dump process (the
>>>> discussion of mysqldump vs mysqlhotcopy seems to be
>>> inconsistent with
>>>> what's at the mysql.com website wrt using hotcopy with
>>> InnoDB tables)?
>>>> Are there any tips people can share?
>>>>
>>>> This came up during a migration of /usr/local/mysql and the apache
>>>> root directory to a new set of disks. I had backed
>>> everything up to
>>>> another set of disks (actually this was temporarily using our dev
>>>> server as a firewire drive). I pointed usr/local and
>>> apache root to
>>>> the backups in the hope that I could keep the wikis online while we
>>>> replaced the main disks on the production server. The plan
>>> was to keep
>>>> this running while we set up the new disks and then copy
>>> data back to
>>>> the new disks, change the symlinks for /usr/local etc to the new
>>>> places, and restart mysql and apache. While this is going on, I've
>>>> disabled editing on the backup copy, but users should be
>>> able to view/
>>>> browse/search. But mysql was very unhappy and wouldn't
>>> run from the
>>>> backups. I ended up deleting all of the files from the
>>> backup copy of
>>>> the mysql data directory and rebuilding all the databases in the
>>>> backup from an SQL dump, with apache turned off for several hours.
>>>>
>>>> I feel like there has to be a better way, even with our small
>>>> operation.
>>>>
>>>> Thanks!
>>>>
>>>> Jim
>>>>
>>>> =====================================
>>>> Jim Hu
>>>> Associate Professor
>>>> Dept. of Biochemistry and Biophysics
>>>> 2128 TAMU
>>>> Texas A&M Univ.
>>>> College Station, TX 77843-2128
>>>> 979-862-4054
>>>>
>>>>
>>>> _______________________________________________
>>>> MediaWiki-l mailing list
>>>> MediaWiki-l [at] lists
>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>>
>>>> _______________________________________________
>>>> MediaWiki-l mailing list
>>>> MediaWiki-l [at] lists
>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>
>>> =====================================
>>> Jim Hu
>>> Associate Professor
>>> Dept. of Biochemistry and Biophysics
>>> 2128 TAMU
>>> Texas A&M Univ.
>>> College Station, TX 77843-2128
>>> 979-862-4054
>>>
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l [at] lists
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l [at] lists
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


acsulli at mi

Jun 23, 2008, 12:32 PM

Post #7 of 12 (2685 views)
Permalink
Re: backup advice wanted [In reply to]

Jim,

You may want to integrate using something like MaatKit's
mk-parallel-dump...multi-threaded mysqldump. It is much faster at
dumping large databases.

http://www.maatkit.org/tools.html
http://maatkit.sourceforge.net/doc/mk-parallel-dump.html

Andrew

-----Original Message-----
From: mediawiki-l-bounces [at] lists
[mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
Sent: Monday, June 23, 2008 3:23 PM
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] backup advice wanted

What the heck, might as well post it to the list; that way others can
suggest improvements! This is my changed version from Dan's

Jim
==============
#!/bin/bash

DBname=<mysql_db_name>
DBuser=<mysql_username>
DBpassword=xxxx

DUMPDIR=/usr/local/sql_dumps # path to where you want the dumps saved

TIMESTAMP=`date +%a`

DUMPFILE=$DBname.Dump.$TIMESTAMP.sql

echo "Dumping $DBname to ... $DUMPFILE"

mysqldump $DBname -u $DBuser -p$DBpassword > $DUMPDIR/$DUMPFILE

echo "Zipping $DUMPFILE to ... $DUMPFILE.gz"

tar -czf $DUMPDIR/$DUMPFILE.tgz $DUMPDIR/$DUMPFILE ==============
Notes:
- I don't think the specification of bash matters.
- replace the obvious values for dbname, user, pass etc.
- the date +%a gives a 3 letter day of the week
- tar is probably overkill, Dan's original used gzip. I had some
problems with that, which I suspect is OSX weirdness. Or just store it
uncompressed.
- when running from cron, I comment out the echos.


On Jun 23, 2008, at 1:43 PM, dKosopedia admin wrote:

> I too would like a copy of this shell script.
>
> thanks
>
>
> On Jun 23, 2008, at 12:27 PM, Scott Thile wrote:
>
>> This sounds like a good backup solution for my situation too.
>>
>> Dan, any chance I can get a copy of your modified shell script? If
>> so, my address is:
>> mailto:sethile.pipes [at] gmail
>>
>> Hopefully I can figure out how to modify and implement it for our
>> situation too.
>>
>> Thanks, Scott
>>
>>> -----Original Message-----
>>> From: mediawiki-l-bounces [at] lists
>>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim Hu
>>> Sent: Monday, June 23, 2008 10:26 AM
>>> To: MediaWiki announcements and site admin list
>>> Subject: Re: [Mediawiki-l] backup advice wanted
>>>
>>>
>>> Thanks. Good to know that this works.
>>>
>>> Even though our largest are quite a bit bigger, I decided that this
>>> would work, esp. if we do it at 1AM. I modified a shell script that

>>> Dan Bolser sent me off-list and we're now doing it daily where the
>>> filename includes the day of the week so we have a rotating set
>>> going back one week. These get backed up via the regular file
>>> backup so we should be able to go back further.
>>>
>>> Jim
>>>
>>> On Jun 23, 2008, at 9:25 AM, Christensen, Courtney wrote:
>>>
>>>> Hi Jim,
>>>>
>>>> We routinely use mysqldump on live wikis. The only
>>> consideration is,
>>>> "Is content likely to change while the dump is happening?" So you
>>>> could lock the wiki for editing while you dump if you want. Our
>>>> largest wikis seem to take 30 minutes to dump at most. But then
>>>> our
>>> largest aren't
>>>> very large, about ten thousand pages.
>>>>
>>>> Does that help?
>>>> -Courtney
>>>>
>>>> PS. Don't forget to back up your uploads.
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: mediawiki-l-bounces [at] lists
>>>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of Jim
>>>> Hu
>>>> Sent: Friday, June 13, 2008 2:51 AM
>>>> To: MediaWiki announcements and site admin list
>>>> Subject: [Mediawiki-l] backup advice wanted
>>>>
>>>> Hi all,
>>>>
>>>> Having learned the hard way that just doing Retrospect filesystem
>>>> backups does not always work on the database... I'm looking
>>> for advice
>>>> on how to do backups for our public wikis to minimize downtime when

>>>> we're doing server maintenance.
>>>>
>>>> I've looked at the docs at:
>>>>
>>>> http://www.mediawiki.org/wiki/Backup
>>>>
>>>> and I'm still a bit confused. Assuming that I'll be using
>>> mysqldump...
>>>> do I need to take the wiki offline during the dump process (the
>>>> discussion of mysqldump vs mysqlhotcopy seems to be
>>> inconsistent with
>>>> what's at the mysql.com website wrt using hotcopy with
>>> InnoDB tables)?
>>>> Are there any tips people can share?
>>>>
>>>> This came up during a migration of /usr/local/mysql and the apache
>>>> root directory to a new set of disks. I had backed
>>> everything up to
>>>> another set of disks (actually this was temporarily using our dev
>>>> server as a firewire drive). I pointed usr/local and
>>> apache root to
>>>> the backups in the hope that I could keep the wikis online while we

>>>> replaced the main disks on the production server. The plan
>>> was to keep
>>>> this running while we set up the new disks and then copy
>>> data back to
>>>> the new disks, change the symlinks for /usr/local etc to the new
>>>> places, and restart mysql and apache. While this is going on, I've

>>>> disabled editing on the backup copy, but users should be
>>> able to view/
>>>> browse/search. But mysql was very unhappy and wouldn't
>>> run from the
>>>> backups. I ended up deleting all of the files from the
>>> backup copy of
>>>> the mysql data directory and rebuilding all the databases in the
>>>> backup from an SQL dump, with apache turned off for several hours.
>>>>
>>>> I feel like there has to be a better way, even with our small
>>>> operation.
>>>>
>>>> Thanks!
>>>>
>>>> Jim
>>>>
>>>> =====================================
>>>> Jim Hu
>>>> Associate Professor
>>>> Dept. of Biochemistry and Biophysics
>>>> 2128 TAMU
>>>> Texas A&M Univ.
>>>> College Station, TX 77843-2128
>>>> 979-862-4054
>>>>
>>>>
>>>> _______________________________________________
>>>> MediaWiki-l mailing list
>>>> MediaWiki-l [at] lists
>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>>
>>>> _______________________________________________
>>>> MediaWiki-l mailing list
>>>> MediaWiki-l [at] lists
>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>
>>> =====================================
>>> Jim Hu
>>> Associate Professor
>>> Dept. of Biochemistry and Biophysics
>>> 2128 TAMU
>>> Texas A&M Univ.
>>> College Station, TX 77843-2128
>>> 979-862-4054
>>>
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l [at] lists
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l [at] lists
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


roger at rogerchrisman

Jun 23, 2008, 11:30 PM

Post #8 of 12 (2663 views)
Permalink
Re: backup advice wanted [In reply to]

How can I see what character set my MediaWiki's mysql database is using?

The following tip from
http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki#Character_set
did not work for me:

"You can see which character set your tables are using with a statement like
SHOW CREATE TABLE text. The last line will include a DEFAULT
CHARSET clause."

Here's my attempt to do that:

--------------------------------------------------

[roger [at] cpanel6 ~]$ mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5295221
Server version: 5.0.45-community-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW CREATE TABLE text
->
---------------------------------------------------

I know little about mysql. Do you see what I did wrong?

I'm worried that my database might be in character set "latin1" and
that mysqldump may corrupt my backup database by auto-converting it to
"UTF-8". I don't know what character set the database actually is in
and don't want to mess it up setting it to "latin1" if it is not
already that.

How can I check the character set of my MediaWiki's mysql database (it
is on a Redhat Linux server)?

Thanks!
Roger
* MediaWiki: 1.9.2
* PHP: 5.2.6 (cgi)
* MySQL: 5.0.45-community-log

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


matsch at rockinchina

Jun 24, 2008, 12:29 AM

Post #9 of 12 (2663 views)
Permalink
Re: backup advice wanted [In reply to]

Hi,

Am Mon, 23 Jun 2008 23:30:06 -0700
schrieb roger [at] rogerchrisman:

> How can I see what character set my MediaWiki's mysql database is
> using?

[..]

> mysql> SHOW CREATE TABLE text
> ->

you have to check for the correct name of your table. For me it is
wiki_text => "SHOW CREATE TABLE wiki_text"

Regards,
Matthias

--
Rock in China
http://wiki.rockinchina.com/
http://www.rockinchina.com/

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


acsulli at mi

Jun 24, 2008, 4:13 AM

Post #10 of 12 (2650 views)
Permalink
Re: backup advice wanted [In reply to]

Also, make sure you end your statement with ";" or "\G"...


If you are using MySQL 5, then you can get the information you want from
the information_schema tables...

SELECT table_collation
FROM information_schema.tables
WHERE table_name = 'text' AND table_schema = 'database_name'

Be sure to change the "database_name" above to the name of the database
you are using. If you want to see the collation from all tables for the
wiki, just leave off the part of the WHERE statement that specifies the
table.

Andrew

-----Original Message-----
From: mediawiki-l-bounces [at] lists
[mailto:mediawiki-l-bounces [at] lists] On Behalf Of Matthias
Korn
Sent: Tuesday, June 24, 2008 3:30 AM
To: mediawiki-l [at] lists
Subject: Re: [Mediawiki-l] backup advice wanted

Hi,

Am Mon, 23 Jun 2008 23:30:06 -0700
schrieb roger [at] rogerchrisman:

> How can I see what character set my MediaWiki's mysql database is
> using?

[..]

> mysql> SHOW CREATE TABLE text
> ->

you have to check for the correct name of your table. For me it is
wiki_text => "SHOW CREATE TABLE wiki_text"

Regards,
Matthias

--
Rock in China
http://wiki.rockinchina.com/
http://www.rockinchina.com/

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


ChristensenC at BATTELLE

Jun 24, 2008, 5:17 AM

Post #11 of 12 (2663 views)
Permalink
Re: backup advice wanted [In reply to]

-----Original Message-----
From: mediawiki-l-bounces [at] lists
[mailto:mediawiki-l-bounces [at] lists] On Behalf Of Matthias
Korn
Sent: Tuesday, June 24, 2008 3:30 AM
To: mediawiki-l [at] lists
Subject: Re: [Mediawiki-l] backup advice wanted

Hi,

Am Mon, 23 Jun 2008 23:30:06 -0700
schrieb roger [at] rogerchrisman:

> How can I see what character set my MediaWiki's mysql database is
> using?

[..]

> mysql> SHOW CREATE TABLE text
> ->

Just to make sure, you are putting a semi-colon (;) at the end of your
MySQL statements right?

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


roger at rogerchrisman

Jun 25, 2008, 2:06 PM

Post #12 of 12 (2641 views)
Permalink
Re: backup advice wanted [In reply to]

I have no prior experience invoking mysql queries on the command line.
Now (I think) I know to use a semicolon (;) on the end of last line in
a query. Thank you for mentioning that.

The below mysql session worked for me and seems to indicate my
MediaWiki database (roger_wgdb) is character encoded
"latin1_swedish_ci". How odd.

Is "latin1_swedish_ci" normal or default for MediaWiki?
(I was expecting "latin1" because my MediaWiki is in English on a
Dathorn.com virtual Web hosting server in USA and "latin1" is
indicated by status in the bottom part of my mysql session, copied
below. This MediaWiki was born on a FreeBSD box, moved to
Dreamhost.com virtual Web hosting, then here to Dathorn.com virtual
Web hosting. All in USA but that first, FreeBSD, box may have set the
database character encoding of my wiki born on it, and that box is no
longer available to check status on. So I appear to be stuck in
character encoding "latin1_swedish_ci", right?

So, should I specify --default-character-set=latin1_swedish_ci in my
mysqldump backup commands?


=== Here's my mysql session indicating "latin1_swedish_ci" ===

mysql> SELECT table_collation
-> FROM information_schema.tables
-> WHERE table_schema = 'roger_wgdb';
+-------------------+
| table_collation |
+-------------------+
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
| latin1_swedish_ci |
+-------------------+
35 rows in set (0.86 sec)

mysql> status;
--------------
mysql Ver 14.12 Distrib 5.0.45, for pc-linux-gnu (i686) using readline 5.0

Connection id: 14978
Current database:
Current user: roger [at] localhos
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.45-community-log MySQL Community Edition (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 1 hour 42 min 24 sec

Threads: 1 Questions: 375766 Slow queries: 20 Opens: 3775 Flush
tables: 1 Open tables: 3676 Queries per second avg: 61.160
--------------

mysql>

=== End mysql session ===


Thanks!
Roger
* MediaWiki: 1.9.2
* PHP: 5.2.6 (cgi)
* MySQL: 5.0.45-community-log

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.