<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James&#039; Tools and Tricks &#187; backup</title>
	<atom:link href="http://jrudd.org/wordpress/tag/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrudd.org/wordpress</link>
	<description>Tools, Tips and Hints for managing a network.</description>
	<lastBuildDate>Mon, 26 Jul 2010 03:13:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using BackupPC with DiskShadow to backup open files</title>
		<link>http://jrudd.org/wordpress/2010/07/16/using-backuppc-with-diskshadow-to-backup-open-files/</link>
		<comments>http://jrudd.org/wordpress/2010/07/16/using-backuppc-with-diskshadow-to-backup-open-files/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:59:48 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[backuppc]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[DiskShadow]]></category>
		<category><![CDATA[noacl]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[server 2008 R2]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[Task Scheduler]]></category>
		<category><![CDATA[VShadow]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/?p=151</guid>
		<description><![CDATA[This post is to assist in the setup of a BackupPC system able to backup in use files by using MS volume snapshots. It also has the benefit of only having the RSync daemon running during the backup which increases security.]]></description>
			<content:encoded><![CDATA[
<h1>Introduction</h1>
<p>This post is to assist in the setup of a BackupPC system able to  backup in use files by using MS volume snapshots. It also has the  benefit of only having the RSync daemon running during the backup which  increases security.</p>
<p>This method is based on some other posts I  have seen using <a href="http://www.goodjobsucking.com/?p=62">VShadow</a>, <a href="http://www.goodjobsucking.com/?p=62"><em>Backing Up Open Files on Windows with Rsync</em></a>, and some  suggestions on <a href="http://www.goodjobsucking.com/?p=62&amp;cpage=2#comment-3159">DiskShadow</a> but goes further in using RSync as a system service giving full access  to files, and removing the need to use winexe.</p>
<h2>General Outline</h2>
<ol>
<li>Create a new user <em><strong>backuppc </strong></em>(try to match case of the user on Linux). Very limited rights</li>
<li>Install Cygwin with RSync, OpenSSH and configure them</li>
<li>Create a scheduled task to run as SYSTEM when triggered by a certain event</li>
<li>Set BackupPC server for passwordless login to host and modify Pre/Post Dump Cmds</li>
</ol>

<h1>Overview</h1>
<p>In Windows 7 and Server 2008 R2 elevation is required to create snapshots. As a remote SSH connection cannot bypass UAC a way is needed to create the snapshot, bypassing the elevation prompt. I also wished to run the Rsync Daemon as SYSTEM user so it has rights to view all files.</p>
<p>To do this I moved all the elevated tasks into a Task Scheduler item that is set to run as SYSTEM, and is triggered by an Event log event.</p>
<ol>
<li>BackupPC performs a password-less key SSH logon to client</li>
<li>It runs a script which creates an event log entry and then waits for RSync to start before returning to BackupPC and starting the backup.</li>
<li>Task scheduler is triggered by <a href="http://support.microsoft.com/kb/315410">Event Log</a> and starts DiskShadow as SYSTEM.</li>
<li>Disk shadow creates a shadow of any chosen volumes, mounts them and then starts RSync.<br />
It then waits for a file to be created by BackupPC at the end of the backup telling it to stop RSync and delete the snaphots.</li>
</ol>
<h3>Flow and triggers</h3>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="205" valign="top"><strong>BackupPC Server</strong></td>
<td colspan="2" width="411" valign="top"><strong>Host PC</strong></td>
</tr>
<tr>
<td width="205" valign="top"><strong>backuppc User</strong></td>
<td width="205" valign="top"><strong>backuppc User</strong></td>
<td width="205" valign="top"><strong>SYSTEM</strong></td>
</tr>
<tr>
<td style="text-align: center;" colspan="3" width="411" valign="top"><strong>Start Backup</strong></td>
</tr>
<tr>
<td width="205" valign="top">SSH to Host PC</td>
<td width="205" valign="top"></td>
<td width="205" valign="top"></td>
</tr>
<tr>
<td width="205" valign="top"></td>
<td width="205" valign="top">Log Event</td>
<td width="205" valign="top">Diskshadow: Snaphsot</td>
</tr>
<tr>
<td width="205" valign="top"></td>
<td width="205" valign="top"></td>
<td width="205" valign="top">Start Rsync</td>
</tr>
<tr>
<td width="205" valign="top"></td>
<td width="205" valign="top">Close and return</td>
<td width="205" valign="top"></td>
</tr>
<tr>
<td width="205" valign="top">Begin Backup</td>
<td width="205" valign="top"></td>
<td width="205" valign="top"></td>
</tr>
<tr>
<td style="text-align: center;" colspan="3" width="411" valign="top"><strong>Finish Backup</strong></td>
</tr>
<tr>
<td width="205" valign="top">SSH to Host PC</td>
<td width="205" valign="top"></td>
<td width="205" valign="top"></td>
</tr>
<tr>
<td width="205" valign="top"></td>
<td width="205" valign="top">Create a Wake.up file</td>
<td width="205" valign="top"></td>
</tr>
<tr>
<td width="205" valign="top"></td>
<td width="205" valign="top"></td>
<td width="205" valign="top">Stop Rsync</td>
</tr>
<tr>
<td width="205" valign="top"></td>
<td width="205" valign="top"></td>
<td width="205" valign="top">Delete Snaphost</td>
</tr>
</tbody>
</table>
<h1>Host PC</h1>
<p>Create a new user, <em><strong>backuppc</strong></em>, you can limit this account further in Security policy after everything is configured.</p>
<p>Create a BackupPC folder and add the following scripts to it. These are also available in a <a href="http://jrudd.org/wordpress/download/general/BackupPC-Config.zip">zip file</a>. Note: There is a file embedded within this post, please visit this post to download the file. You will need to modify paths depending on where you create the folder. I used C:\cygwin\BackupPC but a better location may be C:\cygwin\usr\share\BackupPC</p>
<p>Most of these scripts are just modified versions of the ones written for <a href="http://www.goodjobsucking.com/?p=62">VShadow</a>, changed to work with DiskShadow and Task Scheduler.</p>
<p><strong>pre-cmd.vbs</strong></p>
<pre class="brush: vb; collapse: true; light: false; toolbar: true;">' This file starts the commands
' It will start the snapshot process and quite once RSync is running

Const Rsync = &quot;C:\cygwin\var\run\rsyncd.pid&quot;
Const Flag = &quot;C:\cygwin\var\run\wake.up&quot;
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
'
' Pid file shouldn't be there already
' Check /stop service , still there delete
'
If DoesFileExist(Rsync)=0 Then
	fso.DeleteFile(Rsync)
End If
'
' Nor should &quot;wake.up&quot;
'
If DoesFileExist(Flag)=0 Then
   fso.DeleteFile(Flag)
End If

Set objShell = CreateObject(&quot;WScript.Shell&quot;)
' objShell.Exec &quot;C:\BackupPC\backuppc.cmd &gt; &quot; &amp; Log

' This writes event log entry that triggers task scheduler to start system process
' that takes snapshot and starts RSync
objShell.Exec &quot;Logevent.exe -r &quot;&quot;BackupPC&quot;&quot; -e 10 -s S &quot;&quot;Backup Start&quot;&quot; &quot;
Wscript.Echo &quot;Sent BackupPC Event Log Trigger&quot;

'
' Just sleep until the file &quot;rsyncd.pid&quot; appears
'

While DoesFileExist(Rsync)
   wscript.sleep 10000
Wend

' functions

function DoesFileExist(FilePath)
Dim fso
	Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
	if not fso.FileExists(FilePath) then
		DoesFileExist = -1
	else
		DoesFileExist = 0
	end if
	Set fso = Nothing

end function</pre>
<p><strong>backuppc.cmd</strong></p>
<pre class="brush: plain; collapse: true; light: false; toolbar: true;">c:
cd C:\cygwin\BackupPC
diskshadow /s DiskShadowScript.txt /l C:\cygwin\var\log\diskshadow.log
del C:\cygwin\var\tmp\*.cab /q
c:cd C:\cygwin\BackupPCdiskshadow /s DiskShadowScript.txt /l C:\cygwin\var\log\diskshadow.log
del C:\cygwin\var\tmp\*.cab /q</pre>
<p><strong>DiskShadowScript.txt</strong></p>
<pre class="brush: plain; collapse: true; light: false; toolbar: true;">#DiskShadow script file

#Make shadows persistent, No writers as data volume

# If backing up C: and any app files (ntds, database, etc) use writers

#SET CONTEXT PERSISTENT NOWRITERS

SET CONTEXT PERSISTENT

#Cab location for process

SET METADATA C:\cygwin\var\tmp\backup.cab

SET VERBOSE ON

BEGIN BACKUP

#Alias volume with alias

ADD VOLUME C: ALIAS SystemData

ADD VOLUME F: ALIAS UserData

#Create Snapshot

CREATE

#Expose the volume and run command file then unexpose

EXPOSE %UserData% B:

EXPOSE %SystemData% T:

EXEC C:\cygwin\BackupPC\Serverbackup.cmd

UNEXPOSE B:

UNEXPOSE T:

END BACKUP

#Delete the shadow copy

DELETE SHADOWS SET %VSS_SHADOW_SET%

#End of script</pre>
<p><strong>Serverbackup.cmd</strong></p>
<pre class="brush: plain; collapse: true; light: false; toolbar: true;">REM Start RSync now that Snapshots are created

net start rsyncd

REM Need to wait until backup completed

cscript &quot;C:\cygwin\BackupPC\sleep.vbs&quot;

Logevent.exe -r &quot;BackupPC&quot; -e 20 -s S &quot;Backup Completed&quot;
</pre>
<p><strong>sleep.vbs</strong></p>
<pre class="brush: vb; collapse: true; light: false; toolbar: true;">Const Rsync = &quot;C:\cygwin\var\run\rsyncd.pid&quot;
Const Flag = &quot;C:\cygwin\var\run\wake.up&quot;
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)

' Just sleep until the file &quot;rsyncd.pid&quot; appears
While DoesFileExist(Rsync)
   wscript.sleep 10000
Wend

' Now sleep until the file &quot;wake.up&quot; appears
While DoesFileExist(Flag)
   wscript.sleep 10000
Wend

fso.DeleteFile(Flag)

' It's time to kill Rsync
'Stop Service
strServiceName = &quot;rsyncd&quot;
Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;)
Set colListOfServices = objWMIService.ExecQuery(&quot;Select * from Win32_Service Where Name ='&quot; &amp; strServiceName &amp; &quot;'&quot;)
For Each objService in colListOfServices
    objService.StopService()
	Wscript.Echo &quot;RSyncD Stopped&quot;
Next

' Wait for Rsync to let go
wscript.sleep 5000

' Delete PID file
If DoesFileExist(Rsync)=0 Then
   fso.DeleteFile(Rsync)
End If

' functions
function DoesFileExist(FilePath)
Dim fso
	Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
	if not fso.FileExists(FilePath) then
		DoesFileExist = -1
	else
		DoesFileExist = 0
	end if
	Set fso = Nothing

end function
</pre>
<h2>Cygwin</h2>
<p>Install Cygwin and choose to install packages RSync and OpenSSH</p>
<p>Start an elevated Cygwin (Run as an Administrator )</p>
<h4>Config</h4>
<p>Cygwin 1.7 changes the way to ignore NT Security from the <em>nontsec </em>environment to modifying fstab file.</p>
<p>In your prefered editor modify /etc/fstab and uncomment the bottom line and add <em>noacl </em>as below, this tells it to ignore security :</p>
<pre class="brush: plain; light: true;">none /cygdrive cygdrive binary,noacl,posix=0,user 0 0</pre>
<p>Run following to update group and user lists (if on a domain only add the users you want)</p>
<p>[bashlight=1]mkpasswd –l >/etc/passwd<br />
mkgroup –l /etc/group[/bash]</p>
<h3>OpenSSH</h3>
<p>Configure Open SSH using <em>ssh-host-config</em>, create both the accounts it suggests for privilege isolation and running the service (cyg_service &amp; sshd).<br />
This should also automatically add the Firewall Exceptions (SSHD).</p>
<h4>Setting up Keyless</h4>
<p><span style="font-weight: normal;">Login as backuppc user.</span><br />
<span style="font-weight: normal;"> </span><span style="font-weight: normal;">Use </span></p>
<pre class="brush: plain; light: true;">runas /user:backuppc cmd</pre>
<p>Or</p>
<pre class="brush: plain; light: true;">runas /user:domain\backuppc cmd</pre>
<p>Run c:\cygwin\Cygwin.bat to start Cygwin as BackupPC user</p>
<p>You need to add the id_rsa.pub file from the BackupPC user on BackupPC server to C:\cygwin\home\backuppc\.ssh\authorized_keys If you have not already created one follow the instructions below in BackupPC &#8211; SSH section.</p>
<h3>RSync</h3>
<p>To install RSync as a system service use:</p>
<pre class="brush: plain;">C:\cygwin\bin\cygrunsrv.exe -I rsyncd -d &quot;RSync Daemon&quot; -O --type manual -p /bin/rsync.exe -f &quot;Used by BackupPC to remotely access files for backup&quot; -a &quot; --config=/etc/rsyncd.conf --daemon --no-detach&quot;</pre>
<p>Modify the /etc/rsyncd.conf file to reflect what drives you want to backup. It is better to edit this file later after you have modified the DiskShadowScript.txt and changed which drive letter it exposes shadows as.</p>
<p>Add a RSync exception to the firewall.</p>
<p>Open <em>Windows Firewall with Advanced Security</em> and choose Inbound Rules, New Rule, Program,  Next</p>
<p>Browse to C:\cygwin\bin\rsync.exe and then choose your options and name the rule</p>
<p>When finished open the rule, click Scope tab and add a Remote IP, that of the BackupPC server. This restricts RSync to only be accessible from BackupPC. You may also wish to similarly modify SSHD to only allow SSH access from BackupPC server.</p>
<h2>DiskShadow</h2>
<p>If you are backing up a windows Server 2008 or 2008 R2 host you already have DiskShadow installed. However, if you are running Windows 7 or Vista you will need to grab a copy from an equivalent server (x86 or x64). It is located in the System32 directory and you will also need the language file from the en-US folder.</p>
<p>I have <a href="http://jrudd.org/wordpress/download/utilities/DiskShadow.zip">zipped the files needed</a> for x86 and x64 if you do not have immediate access to a Server.Note: There is a file embedded within this post, please visit this post to download the file. (The x86 files are from Server 2008 and x64 are from 2008 R2)</p>
<p>Copy the files from your architecture to the system32 directory and en-US subdirectory.</p>
<h3>LogEvent</h3>
<p>To generate the custom event log entry a tool from the Windows 2000 Resource kit is used, <a href="http://support.microsoft.com/kb/315410">LogEvent</a>, (<a href="http://www.dynawell.com/download/reskit/microsoft/win2000/logevent.zip">Download</a>). This needs to be either placed in the Path (e.g. Windows dir) or scripts need to directly call it.</p>
<h2>Task Scheduler</h2>
<p>The easiest way to configure this is to manually run LogEvent once to generate an event in the log.</p>
<pre class="brush: plain; light: true;">Logevent.exe -r &quot;BackupPC&quot; -e 10 -s S &quot;Backup Start&quot;</pre>
<p>Then open Event Viewer, Select the new BackupPC event and choose <em>Attach Task to this Event</em>, and in the wizard click next until it asks for the program, then give it <strong>C:\cygwin\BackupPC\backuppc.cmd</strong></p>
<p>On Final page choose to <em>Open Properties</em> when you click Finish</p>
<p>Click the <em>Change User or Group</em> button and type in <strong>System </strong>as the user  and click OK. Also tick the <em>Run with highest privileges</em> box</p>
<h1>BackupPC Server</h1>
<h2>SSH</h2>
<p>This section is only needed if you do not already have keys generated for the backuppc user.</p>
<p>Login as backuppc user, either with password or simply “su – backuppc” from root</p>
<p>Generate SSH Keys, <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"><em>ssh-keygen –t rsa</em></span>, do not set a password. Copy id_rsa.pub into C:\cygwin\home\backuppc\.ssh \authorized_keys</p>
<p>Test by running <em>ssh -v backuppc@host</em> to test the connection</p>
<h2>BackupPC Host File</h2>
<p>In the web interface change the following for the host.</p>
<pre class="brush: plain; light: true;">DumpPreUserCmd:  $sshPath -q -x -l backuppc $host cscript &quot;C:\cygwin\BackupPC\pre-cmd.vbs&quot;
 DumpPostUserCmd: $sshPath -q -x -l backuppc $host echo &quot;Complete: $xferOK&quot; &gt; /var/run/wake.up</pre>
<h2>Test Run</h2>
<p>If you have existing backups from a previous RSync config, it is a good idea to run a full backup to ensure any in use files are part of the base. In my case I also changed the <em>noacl </em>flag which affected the file attributes RSync sees.</p>
<h1>Tips</h1>
<p>Set your antivirus to exclude the exposed drives. As they are read only it just slows down the reading of files by RSync.</p>
<h3>Downloads</h3>
Note: There is a file embedded within this post, please visit this post to download the file.
<h1>Updates</h1>
<ul>
<li>While writing this up I found a good alternative way of using VShadow with SSH to backup in use files, that uses the AT command instead of task scheduler to get around UAC, <a href="http://geraldbrandt.com/2010/06/08/backuppc-with-sshrsyncvss-on-windows-server/">BackupPC with ssh/rsync/VSS on Windows Server</a>. The only down side to this method is the SSH connection requires an Admin account, but if configured securely this should be fine. It also a lot simpler to configure as it does not require configuring Task Scheduler.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/wordpress/2010/07/16/using-backuppc-with-diskshadow-to-backup-open-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moodle Structure Problems</title>
		<link>http://jrudd.org/wordpress/2009/06/18/moodle-structure-problems/</link>
		<comments>http://jrudd.org/wordpress/2009/06/18/moodle-structure-problems/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 07:10:44 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Moodle]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Meld]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/?p=106</guid>
		<description><![CDATA[Recently I discovered our Moodle gradebook was playing up and not correctly recording marks from assignments as well as been unable to assign categories from quizes.
I tracked the problem down to the Moodle database losing all its default entries for its tables.]]></description>
			<content:encoded><![CDATA[<p>WARNING: DO NOT ATTEMPT ANY OF THIS IF YOU DO NOT FULLY UNDERSTAND IT. YOU CAN DESTROY YOUR MOODLE SITE.</p>
<p>Recently I discovered our Moodle gradebook was playing up and not correctly recording marks from assignments as well as been unable to assign categories from quizes.</p>
<p>I tracked the problem down to the Moodle database losing all its default entries for its tables. The cause is unknown but is quite likely the <a title="UTF Convert" href="http://moodle.org/mod/forum/discuss.php?d=97592">UTF conversion utility</a> I ran previously to make the system compatible with Asian languages for LOTE.</p>
<p>To fix this problem I needed to recreate the Moodle DB structure and then reimport the data.</p>
<h2>Backup</h2>
<p>First make a backup. I made a mistake the first time I tried repairing this and the backup I made saved me.</p>
<pre class="brush: bash;">mysqldump -u backupacc -p -Q --opt moodle &gt; moodleBackup.sql</pre>
<p>I created a duplicate site with a clean DB (copy the moodle folder and create a new DB) and went through the install. This needs to have all your modules and blocks to ensure all tables are created.</p>
<p>I then dumped the structure from this new DB and the old DB and compared them using Meld (or any other diffing program will work).</p>
<pre class="brush: bash;"> mysqldump -u backupacc -p --no-data --skip-add-drop-table moodletest2 &gt; moodleGoodStruc.sql
mysqldump -u backupacc -p -d --skip-add-drop-table moodle &gt; moodleOldStruc.sql</pre>
<p>Using Meld determine if there are any extra tables or fields in your current system that don&#8217;t exist in the clean one.</p>
<p>Then you need to determine if it is safe to delete those tables / field in your main DB or if they need to be added to the clean system. e.g. grade_items_history.decimals and grade_items_history.display were in the main DB but not the new one. After searching for it discovered they can be removed (<a href="http://tracker.moodle.org/browse/MDL-15985">MDL-15985</a>).</p>
<p>After getting them to match you need to dump your Moodle data from your main site.</p>
<p>You can speed up the next steps by reducing the size of backup_log if you wish. Just do a</p>
<pre class="brush: sql;">
Delete
FROM `mdl_backup_log`
WHERE `time` &lt;1242777600
</pre>
<p>Where the time code is <a href="http://converteverything.com/conversions/unix_time.htm">calculated as a unix time code</a> from about a month before todays date. This can reduce alot of space of your DB, and improve import/export times.</p>
<pre class="brush: bash;">mysqldump -u backupacc -p  --no-create-info --extended-insert --complete-insert moodle &gt; moodleData200906171559.sql</pre>
<p>You need the <strong>&#8211;complete-insert</strong> option to ensure each insert is labelled with field name, in case field order is different. I didn&#8217;t do this the first time and needed to restore the backup.</p>
<h2>Testing Merge</h2>
<p>Now you need to test it. Create a new empty DB and import the Structure then import your data.</p>
<pre class="brush: bash;">mysql -u root -p moodleTest3 &lt; moodleStruc.sql
mysql -u root -p moodleTest3 &lt; moodleData200906171559.sql</pre>
<p>Check that no errors occurred during import, this is when I discovered most of my problems with extra non existent field.</p>
<h2>Prep for Applying</h2>
<p>Put your site in Maintenance mode so no users can login while you are testing this. (i.e. when you restore data site will already be in maintenance mode)</p>
<p>When everything is OK do another backup, as after this you are going to <strong>delete it all</strong>. (I recommend taking your site completely offline for this, not just maintenance mode. Edit your config.php and temporarily change either the username, password or db name or your database settings.)</p>
<p>Now re-export the Data again (assuming your site has been running while you have been doing tests)</p>
<pre class="brush: bash;">mysqldump -u backupacc -p  --no-create-info --extended-insert --complete-insert moodle &gt; moodleData200906171559.sql</pre>
<h2>Applying to Site</h2>
<p><strong>WARNING: HAVE A GOOD RELIABLE BACKUP BEFORE THIS STEP.  THIS WILL DESTROY YOUR MOODLE SITE.</strong></p>
<p>Now use phpMyAdmin to drop every table in the Moodle main DB. Just use Check All at the bottom and select Drop.</p>
<p>Now you need to redo your test restore above but to your main DB.</p>
<p>Once complete reconnect your config.php file and check everything on your site looks the same. Open some courses, check some gradebooks, have a look around.</p>
<p>When its OK take out of Maintenance mode and you should be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/wordpress/2009/06/18/moodle-structure-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
