Microsoft KB Archive/323944

= HOW TO: Back Up Existing Sites and Configurations Before a UNIX-to-Windows Migration =

Article ID: 323944

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Small Business Server 2000 Standard Edition
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q323944





IN THIS TASK
SUMMARY Backing Up Apache Configurations
 * Backing Up to a File
 * Backing Up to Tape
 * Restoring the Configuration

Backing Up Apache Web Sites
 * Restoring an Apache Web Site

Backing up Data in Databases Restoring the Data in Databases REFERENCES



SUMMARY
This step-by-step article describes how to back up existing sites and configurations before a UNIX-to-Windows migration.

back to the top

Backing Up Apache Configurations
For each installed and active Apache installation, the main Apache configuration files are located in a single folder, conf. Typically, the conf folder only contains one important file, Httpd.conf, but it may also contain additional files that are used during the configuration such as Srm.conf or Access.conf.

back to the top

Backing Up to a File
To back up the whole folder to a single file by using the tar command:
 * 1) Log on to the UNIX server as root.
 * 2) Change to the Apache folder that you want backup. For example, use the cd /usr/local/apache command.
 * 3) Use the tar command to back up the folder. For example, use the tar cf confbackup.tar ./conf command, where confbackup.tar is the name of the file that you want to use to store the backup.

back to the top

Backing Up to a Tape Device
To back up the whole folder to a tape device by using the tar command:
 * 1) Log on to the UNIX server as root.
 * 2) Change to the Apache folder that you want backup. For example, use the cd /usr/local/apache command.
 * 3) Use tar to backup the folder. For example, use the tar cf /dev/rmt0 ./conf command, where /dev/rmt0 is the name of the tape device that you want to use to store the backup.

back to the top

Restoring the Configuration
To restore a configuration from a tape or file, use tar with the x option to extract the data. For example, to recover the configuration from a file:
 * 1) Log on to the UNIX server as root.
 * 2) Change to the Apache folder where you want to restore the configuration folder. For example, use the cd /usr/local/apache command.
 * 3) Use tar to restore the folder, by supplying the name of the tape device or file. For example, use the tar xf confbackup.tar command.

back to the top

Backing Up Apache Web Sites
Web sites in Apache can be stored and served from any location. Typically a whole Web site is stored under a single folder. You can determine the which folders by using the grep utility to extract the DocumentRoot lines from a configuration file. For example, use the grep DocumentRoot /usr/local/apache/conf/httpd.conf DocumentRoot /usr/local/apache/htdocs command. After you determine their location, use tar to back up the documents to a file or tape device:
 * 1) Log on to the UNIX server as root.
 * 2) Change to the parent of the folder that was returned by the DocumentRoot parameter. For example, if the location is /usr/local/apache/htdocs, use the cd /usr/local/apache command.
 * 3) Use tar to back up the whole folder. To back up to a file, use the tar cf htdocsbackup.tar ./htdocs command.
 * 4) To backup to a tape device, use the tar cf /dev/rmt0 ./htdocs command.

Make sure that any folders that are used to hold sections of a site or that hold CGI script elements are backed up. Check the Apache configuration file for more details.

For example, the ScriptAlias directive in an Apache configuration maps a logical folder in a Web site to a physical folder on the server. For example:

ScriptAlias /cgi-bin /usr/local/apache/cgi-bin

These may be outside of the document root for the Web site, and this is shown in this example.

back to the top

Restoring an Apache Web Site
To restore an Apache Web site:
 * 1) Log on to the UNIX server as root.
 * 2) Change to the parent of the folder where you want to restore the Web site folder. For example, use the cd /usr/local/apache command.
 * 3) Use tar to restore the folder by supplying the name of the device or file from which to restore. For example, use the tar xf htdocsbackup.tar command.

back to the top

Backing Up Data in Databases
Most databases include a script or program that dumps the whole contents of a database out to a file. You can then use this file to rebuild the database after a failure or during an upgrade. The files that are generated are typically RDBMS specific, so they cannot typically be used to perform the migration from UNIX to Windows unless you are using the same RDBMS on both platforms.

Under MySQL, the most popular solution under UNIX, the mysqldump tool will dump out the contents of any database into a file.

To use this utility to dump a single database, supply the database name after the command. For example, use the mysqldump mydatabase command. To use this utility to dump two or more databases, add --databases to the command, and then type the list of databases. For example, use the mysqldump --databases mydatabase1 mydatabase2 command. To use this utility to dump all of the databases in an RDBMS, add --all-databases to the command. For example, use the mysqldump --all-databases command.

In all these cases, the information will be dumped to the screen. To save the output in a file, redirect the output. For example, use the mysqldump --all-databases > alldatabases.dmp command.

back to the top

Restoring the Data in Databases
Use the mysqlimport or an equivalent tool to import a previous database dump file back into the RDBMS system. For example, use the mysqlimport database database.dmp command.

back to the top

