
|
 |
Moving DBM (database) files
Posted on: March 29, 2000, 3:21 p.m.
Please Read before attempting to move Home Free to a another server.
Only for those using the dbm database format (database format is indicated on admin.cgi login screen. DBM users will see [dbm] while text based users will see [text]
Home Free uses a module called Any_DBM which as you might assume uses any dbm, or the first database management system it finds. This solves incompatablitly problems between servers when installing Home Free, but then causes problems when a user tries to use one dbm file from server a on server b, since they may be using different DBM formats. Thus the old accounts will not show up on the new server, because the dbm file is not correctly read.
To solve this problem we have developed 2 simple cgi scripts that will allow the transfer of data from server A to server B. First on server A we will break down the original dbm file to a simple text file.... Transport that text file to server B and build a new dbm file from the text file. Follow these simple steps below and you should have no problem moving your Home Free database from one server to another.
Step 1
Download and unzip dump_rebuild.zip (This file is 2kb, and is included with your help folder files so that if you ever need to move your installed version of Home Free v3.24n, this file will be easily accessable (-NnN-) :-)!
Step 2
Upload data_dump.cgi to server A, the server that contains the working Home Free database. Upload this cgi file to the same dir that contains the rest of your Home Free cgi files.
Step 3
Call data_dump.cgi using the format:
data_dump.cgi?db=DATABASE_NAME&out=OUTPUT_FILE
Where DATABASE_NAME is the name of the database you want dumped to the text file, and OUTPUT_FILE is the name of the text file you want created with the dumbed data. The new text file will be created in your Home Free data dir, the same one that contains the database files. All accounts not in a category in Home Free are stored in a database named accounts, and accounts in a category are stored in a database of the category name. Also all category information is stored in a database named category.
For Example a Home Free with users in the base directory and 2 categories, one named sports and the other named arts, would have to run the data_dump file 4 times.... as shown below:
data_dump.cgi?db=accounts&out=accounts_backup.txt
data_dump.cgi?db=sports&out=sports_backup.txt
data_dump.cgi?db=arts&out=arts_backup.txt
data_dump.cgi?db=category&out=category_backup.txt
You now have all the db information in text format.
Step 4
Copy the newly created text files from the data dir of Home Free in server A to the data dir of Home Free on server B.
Step 5
Upload the file data_restore.cgi to the cgi directory of Home Free on server B. Now call data_restore.cgi using the format:
data_restore.cgi?db=DATABASE_NAME&in=INPUT_FILE
Where DATABASE_NAME and INPUT_FILE is the same as you used to make a backup. data_restore will use the INPUT_FILE to build a new db (DATABASE_NAME) What we had backedup before should look like this to rebuild:
data_restore.cgi?db=accounts&in=accounts_backup.txt
data_restore.cgi?db=sports&in=sports_backup.txt
data_restore.cgi?db=arts&in=arts_backup.txt
data_restore.cgi?db=category&in=category_backup.txt
Step 6
That should be it. Log into admin.cgi on Server B and see all the accounts transfered from Server A. If everything went smoothly, be sure to erase the data_dump.cgi and data_restore.cgi from their respective servers as they are security hazards.
|
|