document version 2007.11.22
www.evotiva.com
BackupScript
module – Backup & Restore – Quick Guide. 1
Abstract 1
Backup. 1
Prerequisites 1
Performing
the backup. 1
Restore. 2
Prerequisites 2
Performing
the restore. 2
The document outlines how to backup a DNN web site (full
backup) and restore it somewhere else (other server and/or database).
- BackupScript module should be installed on your site (as
any regular module).
- A valid license key should be present (“License Key” on
the module’s settings page).
- The Asp.NET worker process must have read & write file
system (NTFS file) permissions over the configured backup folder (and
beyond).
Note: this permissions are normally already granted because this is a DNN
“core” requirement (you can check
“DotNetNuke Installation Guide.pdf”, page 12 for more information)
Recommended, before performing the backup:
- Run the “Table’s PKs Validator” (from the module’s actions
menu). Anyway, the module automatically perform this test before
performing the backup.
Note: you can find more information about this feature on the module’s
documentation and the module itself.
To perform a full backup, be sure to enable at least the
following settings (on the module’s settings page):
Regarding to the database backup:
- Backup Database: checked
- Script (backup) table's data: checked
- Backup data for ALL except the assigned tables / Assigned
list = <empty>
- Script DataProviders: checked
- Script Database Objects: checked
(*)
(*)
If
your hosting provider allows this setting ON, it’s advised to enable it.
You’ll
be able to recreate any possible external object (e.g. table or procedure) at
restore time.
“Script
DataProviders” setting allows that all the DNN (core and 3rd party)
database objects (tables, procedures, etc.) could be recreated at restore time.
If
in the source database you have “external” objects (e.g. tables or stored
procedures not created by the DNN core or any of the 3rd party
modules installed) they cannot be recreated, unless you use the “Script
Database Objects” feature.
Regarding to the portal files backup:
- Create Portals Content Zip File:
checked
- Include web.config file: checked
- Include 'Host' (Portals/_default) folder: checked
- Include \bin folder: checked
- Include Modules (\DesktopModules) folder: checked
- Include other folders: checked
- The target database was already created and is empty
Note:
If you’ll use SQL Server Express, a blank Database.mdf under
(web_root)\App_Data will be enough.
- The target web site root was already created, is empty and
the Asp.NET worker process has read & write file system (NTFS file)
permissions over it (and beyond). Note: you
can check “DotNetNuke Installation Guide.pdf”, page 12 for more
information.
- Create this structure (\backup and \bin folders) under the
the web site root:
(WebRoot)
+--- backup
+--- bin
- Upload to /bin:
- All the DLLs contained on the module’s installation package
(Evotiva.BackupScript_xxxxx_Install.zip).
- DotNetNuke.dll that matches your source DNN installation
version (3.x, 4.x)
You can extract it from the portal files backup (myfiles.zip).
Note: in fact, any DotNetNuke.dll
should work (same asp.net version).
- Upload to /backup:
- The database backup zip files (e.g. mydatabase.sql.zip
and myfiles.zip).
- All files included within "Resources.zip" (which
is inside the installation package)
- Browse to <mysite>/backup/default.aspx
e.g.
http://www.mysite.com/backup/default.aspx
- Empty the contents of the
“License Key” textbox
- Click on the <Create simple file> button (it’s next
to “Web.Config:”) and accept the
confirmation message.
Then, configure at least these options:
- Database Backup Filename:
select your uploaded database backup zip file
·
Apply Providers: checked
·
Create objects: unchecked
·
Restore data: checked
- Portal Files Backup Filename: select
your uploaded portal files backup zip file
·
Restore portal files (\Portals
only): unchecked
·
Uncompress ALL portal files to
.\WORK\Site: checked
- License Key: paste a valid
license key for the target domain
- Connection String: write a valid
connection string to your database
- Click on the <Perform Restore> button.
You will see the progress of the
restore operation until completed (a “(restore completed
OK, <date time>)” message will be displayed when finished).
Please notice that the restore
process may take some time, depending on your data volume.
Review the on-screen log - also
written as a text file (mydatabase.sql.zip_RESTORE.log) – for any fatal error.
Some errors applying certain data
providers are normal and expected. By “fatal error” we mean errors when
restoring some table’s data.
If a “fatal error” happened, you will not see “restore
completed OK” and the restore log will be red.
If the database restore failed,
the portal files restore will not be executed.
Use the integrated "SQL Query Tool" to check
& update the PortalAlias table.
-- first find the current alias(es)
SELECT * FROM {databaseOwner}{objectQualifier}portalalias
-- then, update as needed:
-- replace “www.mynewdomain.com” with your (new)
domain name
-- replace “1” with the right value
UPDATE
{databaseOwner}{objectQualifier}portalalias
SET httpalias =
'www.mynewdomain.com'
WHERE portalaliasid = 1;
Final steps:
- Delete (or rename) /web.config file (it was created
from the restore page when clicking on the <Create simple file>
button).
- Delete (or rename) /bin folder.
- All the portal files were extracted below /backup/WORK/Site,
move them below the web site root.
- Delete (or rename) /backup folder.
- Edit the connection strings on the web.config file and you
are ready to browse to your restored site.