<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=Backup</id>
		<title>Backup - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=Backup"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Backup&amp;action=history"/>
		<updated>2026-05-11T05:50:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/index.php?title=Backup&amp;diff=22503&amp;oldid=prev</id>
		<title>Makopoppo: Redirecting to Backups</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Backup&amp;diff=22503&amp;oldid=prev"/>
				<updated>2011-06-04T01:11:04Z</updated>
		
		<summary type="html">&lt;p&gt;Redirecting to &lt;a href=&quot;/wiki/Backups&quot; title=&quot;Backups&quot;&gt;Backups&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:11, 4 June 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Redirect[[Backups]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Redirect[[Backups]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{delete|The contents in this page is merged into [[Backups#Automatic Daily Backups]]}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Makopoppo</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Backup&amp;diff=20805&amp;oldid=prev</id>
		<title>Makopoppo: Redirecting to Backups</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Backup&amp;diff=20805&amp;oldid=prev"/>
				<updated>2011-01-03T03:22:59Z</updated>
		
		<summary type="html">&lt;p&gt;Redirecting to &lt;a href=&quot;/wiki/Backups&quot; title=&quot;Backups&quot;&gt;Backups&lt;/a&gt;&lt;/p&gt;
&lt;a href=&quot;http://opensimulator.org/index.php?title=Backup&amp;amp;diff=20805&amp;amp;oldid=19859&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Makopoppo</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Backup&amp;diff=19859&amp;oldid=prev</id>
		<title>Fritigern at 16:29, 19 November 2010</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Backup&amp;diff=19859&amp;oldid=prev"/>
				<updated>2010-11-19T16:29:11Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:29, 19 November 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 166:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 166:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;font style=&amp;quot;background-color: #f9f9f9&amp;quot; face=&amp;quot;Courier New&amp;quot;&amp;gt;&amp;lt;/font&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;font style=&amp;quot;background-color: #f9f9f9&amp;quot; face=&amp;quot;Courier New&amp;quot;&amp;gt;&amp;lt;/font&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Database]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fritigern</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Backup&amp;diff=16910&amp;oldid=prev</id>
		<title>Tedd: New page: = Backup of OpenSim MySQL&amp;nbsp;database =  == Linux ==  Add something like this to crontab for a weekly/daily/hourly run. (“crontab -e” to edit, “man crontab” to understand how to ...</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Backup&amp;diff=16910&amp;oldid=prev"/>
				<updated>2010-03-05T11:46:05Z</updated>
		
		<summary type="html">&lt;p&gt;New page: = Backup of OpenSim MySQL database =  == Linux ==  Add something like this to crontab for a weekly/daily/hourly run. (“crontab -e” to edit, “man crontab” to understand how to ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Backup of OpenSim MySQL&amp;amp;nbsp;database =&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
Add something like this to crontab for a weekly/daily/hourly run. (“crontab -e” to edit, “man crontab” to understand how to edit)&lt;br /&gt;
&amp;lt;pre&amp;gt;mysqldump -uuser -ppass dbname | gzip &amp;amp;gt; /tmp/mydb_`date +%Y%m%d_%H%M%S`.sql.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
Crontab should e-mail you and errors in backup if it fails. (If your *nix is set up correctly)&lt;br /&gt;
&lt;br /&gt;
To verify the backup gunzip it and look inside the .sql-file, it should contain a DB-dump. For example by executing:&lt;br /&gt;
&amp;lt;pre&amp;gt;zcat /tmp/mydb_YYYYMMDD_HHmmSS.sql.gz | more&amp;lt;/pre&amp;gt;&lt;br /&gt;
To restore a given db:&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /tmp/mydb_YYYYMMDD_HHmmSS.sql.gz | gunzip | mysql -uuser -ppass dbname &amp;lt;/pre&amp;gt;&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
The same as above can be done in Windows, but rotating the date can't be done in batch scripting afaik. I&amp;amp;nbsp;do however have a script for Windows I&amp;amp;nbsp;wrote for my OpenSim.&lt;br /&gt;
&lt;br /&gt;
This is a script for taking a full MySQL backup on Windows (all databases). It required ActiveState Perl and 7zip command line to work. ''It works equally well for Linux, but a few adjustments to paths in header needs to be made.''&lt;br /&gt;
&lt;br /&gt;
ActiveState Perl:&amp;amp;nbsp;[http://www.activestate.com/activeperl/ http://www.activestate.com/activeperl/]&amp;lt;br&amp;gt;7-Zip Command line: [http://www.7-zip.org/download.html http://www.7-zip.org/download.html]&lt;br /&gt;
&amp;lt;pre&amp;gt;use strict;&lt;br /&gt;
use locale;&lt;br /&gt;
#&lt;br /&gt;
# MySQL Backup Script by Tedd Hansen, tedd@konge.net, feb 2010&lt;br /&gt;
#&lt;br /&gt;
# THIS SCRIPT REQUIRES PERL INSTALLED. FOR WINDOWS USE ACTIVESTATE PERL.&lt;br /&gt;
#&lt;br /&gt;
# (1)&lt;br /&gt;
# This script requires a backup-user to be created on the database.&lt;br /&gt;
# Execute this: GRANT ALL on *.* to 'backup-user'@'localhost' identified by 'ZeBackup0perat00r'; &lt;br /&gt;
&lt;br /&gt;
#&amp;amp;nbsp;(change user and password at start of script))&lt;br /&gt;
#&lt;br /&gt;
# (2)&lt;br /&gt;
# To schedule script in Windows you must create a user with log on locally rights like Administrator has.&lt;br /&gt;
# DO NOT USE ADMINISTRATOR USER. If you do then backup will stop working next time we change password.&lt;br /&gt;
# Set startup path to the location of script, and schedule script to execute every 5 hours for example.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Where to put backup&lt;br /&gt;
my $DIR_ROOT = &amp;quot;E:\\Backup&amp;quot;;&lt;br /&gt;
my $DIR_BACKUP = &amp;quot;$DIR_ROOT\\MySQL_Backup&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# What to name backup&lt;br /&gt;
# Note: !DB! will be replaced with database name, !DATE! with current date yyyyMMdd and !TIME! with current time HHmmss&lt;br /&gt;
my $FILETEMPLATE = &amp;quot;MySQL !DB! !DATE! !TIME!.sqldump.7z&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
my $MYSQL_USER=&amp;quot;backup-user&amp;quot;;&lt;br /&gt;
my $MYSQL_PASSWORD=&amp;quot;ZeBackup0perat00r&amp;quot;;&lt;br /&gt;
my $MYSQL_HOST=&amp;quot;localhost&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Full path to binary files we need&lt;br /&gt;
my $BIN_7Z = &amp;quot;$DIR_ROOT\\7za.exe&amp;quot;;&lt;br /&gt;
my $BIN_MYSQLDUMP = &amp;quot;E:\\MySQL\\bin\\mysqldump.exe&amp;quot;;&lt;br /&gt;
my $BIN_MYSQL = &amp;quot;E:\\MySQL\\bin\\mysql.exe&amp;quot;;&lt;br /&gt;
my $CMD_LIST_DB = &amp;quot;echo show databases; | $BIN_MYSQL -u$MYSQL_USER -p$MYSQL_PASSWORD -h $MYSQL_HOST&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# How long before we delete it?&lt;br /&gt;
my $KEEP_HISTORY_FOR_DAYS = 30;&lt;br /&gt;
&lt;br /&gt;
# We are piping MySQLDump output directly into 7z for compression. 7z writes to filesystem.&lt;br /&gt;
#&lt;br /&gt;
# Note: !DB! and !OUTFILE! will be replaced with database name and filename for output file&lt;br /&gt;
# -t7z = 7zip format&lt;br /&gt;
# -mx5 = Medium compression: 0 = none , 9 = ultra .. Note: Increasing compression will use more CPU, and we want to reserve CPU for customers... :)&lt;br /&gt;
# -ms = Create solid archive&lt;br /&gt;
# -mmt = Multithreading&lt;br /&gt;
# -mo=PPMd = PPMd algorithm (good for text, and we have only text)&lt;br /&gt;
my $BACKUP_ARGS = &amp;quot;-u $MYSQL_USER -p$MYSQL_PASSWORD -h $MYSQL_HOST !DB! | $BIN_7Z a -y -t7z -mx7 -ms -mmt -si !OUTFILE!&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
#####################&lt;br /&gt;
## START OF SCRIPT ##&lt;br /&gt;
### ### &lt;br /&gt;
my %DBDONE = {};&lt;br /&gt;
&lt;br /&gt;
# Attempt to create missing dirs&lt;br /&gt;
mkdir &amp;quot;$DIR_ROOT&amp;quot; unless (-d $DIR_ROOT);&lt;br /&gt;
mkdir &amp;quot;$DIR_BACKUP&amp;quot; unless (-d $DIR_BACKUP);&lt;br /&gt;
&lt;br /&gt;
# Check that we got all we need&lt;br /&gt;
die &amp;quot;ERROR: ROOT DIR $DIR_ROOT DOES NOT EXIS!\n&amp;quot; unless (-d $DIR_ROOT);&lt;br /&gt;
die &amp;quot;ERROR: BACKUP DIR $DIR_BACKUP DOES NOT EXIS!\n&amp;quot; unless (-d $DIR_BACKUP);&lt;br /&gt;
die &amp;quot;ERROR: 7Z DOES NOT EXIST AT $BIN_7Z!\n&amp;quot; unless (-f $BIN_7Z);&lt;br /&gt;
die &amp;quot;ERROR: MYSQLDUMP DOES NOT EXIST AT $BIN_MYSQLDUMP!\n&amp;quot; unless (-f $BIN_MYSQLDUMP);&lt;br /&gt;
die &amp;quot;ERROR: MYSQLDUMP DOES NOT EXIST AT $BIN_MYSQL!\n&amp;quot; unless (-f $BIN_MYSQL);&lt;br /&gt;
&lt;br /&gt;
# Delete old backups&lt;br /&gt;
print &amp;quot;Removing backups older than $KEEP_HISTORY_FOR_DAYS days.\n&amp;quot;;&lt;br /&gt;
CleanupOldies();&lt;br /&gt;
&lt;br /&gt;
# Make new backup&lt;br /&gt;
print &amp;quot;Backing up all MySQL databases on $MYSQL_HOST...\n&amp;quot;;&lt;br /&gt;
open(DBLIST, &amp;quot;$CMD_LIST_DB |&amp;quot;);&lt;br /&gt;
while (my $dbname = &amp;amp;lt;DBLIST&amp;amp;gt;) {&lt;br /&gt;
chomp $dbname;&lt;br /&gt;
BackupDatabase($dbname);&lt;br /&gt;
}&lt;br /&gt;
close(DBLIST);&lt;br /&gt;
&lt;br /&gt;
sub CleanupOldies&lt;br /&gt;
{&lt;br /&gt;
# Get what time we should delete files at&lt;br /&gt;
$KEEP_HISTORY_FOR_DAYS = 30 if ($KEEP_HISTORY_FOR_DAYS &amp;amp;lt; 1);&lt;br /&gt;
&lt;br /&gt;
my ($dsec,$dmin,$dhour,$dmday,$dmon,$dyear) = localtime(time - ($KEEP_HISTORY_FOR_DAYS * 24 * 60 * 60));&lt;br /&gt;
my $DDATE = &amp;quot;0000&amp;quot;.($dyear+1900).&amp;quot;:00&amp;quot;.($dmon+1).&amp;quot;:00$dmday&amp;quot;;&lt;br /&gt;
my $DTIME = &amp;quot;00$dhour:00$dmin:00$dsec&amp;quot;;&lt;br /&gt;
$DDATE =~ s/^0*([^:]{4}):0*([^:]{2}):0*([^:]{2}).*/$1$2$3/;&lt;br /&gt;
$DTIME =~ s/^0*([^:]{2}):0*([^:]{2}):0*([^:]{2}).*/$1$2$3/;&lt;br /&gt;
my $CLEANTIME = $DDATE.$DTIME;&lt;br /&gt;
&lt;br /&gt;
opendir(BDIR, &amp;quot;$DIR_BACKUP&amp;quot;);&lt;br /&gt;
while (my $bfile = readdir(BDIR)) &lt;br /&gt;
{&lt;br /&gt;
# Does filename match?&lt;br /&gt;
if ($bfile =~ m/(\d{8})\s+(\d{6})/) {&lt;br /&gt;
my $bfiledate = $1.$2;&lt;br /&gt;
# Is it old?&lt;br /&gt;
if ($bfiledate &amp;amp;lt; $CLEANTIME) {&lt;br /&gt;
print &amp;quot;Deleting old backup file: $bfile\n&amp;quot;;&lt;br /&gt;
unlink &amp;quot;$DIR_BACKUP\\$bfile&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
closedir(BDIR);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub BackupDatabase&lt;br /&gt;
{&lt;br /&gt;
my $dbname = shift;&lt;br /&gt;
&lt;br /&gt;
# Only process each DB once&lt;br /&gt;
return if ($DBDONE{lc($dbname)});&lt;br /&gt;
$DBDONE{lc($dbname)} = 1;&lt;br /&gt;
&lt;br /&gt;
# Get current date&lt;br /&gt;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);&lt;br /&gt;
my $DATE = &amp;quot;0000&amp;quot;.($year+1900).&amp;quot;:00&amp;quot;.($mon+1).&amp;quot;:00$mday&amp;quot;;&lt;br /&gt;
my $TIME = &amp;quot;00$hour:00$min:00$sec&amp;quot;;&lt;br /&gt;
$DATE =~ s/^0*([^:]{4}):0*([^:]{2}):0*([^:]{2}).*/$1$2$3/;&lt;br /&gt;
$TIME =~ s/^0*([^:]{2}):0*([^:]{2}):0*([^:]{2}).*/$1$2$3/;&lt;br /&gt;
&lt;br /&gt;
# Get output filename&lt;br /&gt;
my ($backup_filename) = $FILETEMPLATE;&lt;br /&gt;
$backup_filename =~ s/!DB!/$dbname/i;&lt;br /&gt;
$backup_filename =~ s/!DATE!/$DATE/i;&lt;br /&gt;
$backup_filename =~ s/!TIME!/$TIME/i;&lt;br /&gt;
my ($backupfile) = &amp;quot;$DIR_BACKUP\\$backup_filename&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Get output command&lt;br /&gt;
my ($cmd_mysqldump) = &amp;quot;$BIN_MYSQLDUMP $BACKUP_ARGS&amp;quot;;&lt;br /&gt;
$cmd_mysqldump =~ s/!DB!/$dbname/i;&lt;br /&gt;
$cmd_mysqldump =~ s/!OUTFILE!/\&amp;quot;$backupfile\&amp;quot;/i;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Make backup...&lt;br /&gt;
#&lt;br /&gt;
print &amp;quot;* Backing up database '$dbname'\nTo file: $backupfile\n&amp;quot;;&lt;br /&gt;
print `$cmd_mysqldump`;&lt;br /&gt;
my ($dsec,$dmin,$dhour,$dmday)=localtime(time);&lt;br /&gt;
my $doneTime = &amp;quot;00&amp;quot;.($dmday - $mday).&amp;quot;:00&amp;quot;.($dhour - $hour).&amp;quot;:00&amp;quot;.($dmin - $min).&amp;quot;:00&amp;quot;.($dsec - $sec);&lt;br /&gt;
$doneTime =~ s/^0*([^:]{2}):0*([^:]{2}):0*([^:]{2}):0*([^:]{2}).*/$1d $2:$3:$4/;&lt;br /&gt;
print &amp;quot;Backup of $dbname done in $doneTime.\n\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;background-color: #f9f9f9&amp;quot; face=&amp;quot;Courier New&amp;quot;&amp;gt;&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tedd</name></author>	</entry>

	</feed>