4.) Reverting to a Database Backup
There may be times when you need to revert your database to a backup. Assuming your crontab file has been successfully loaded, xFlow will automatically run every night at 1:00am server time, and depending on your settings, will backup your member database. This chapter explains exactly how to revert your database to a backup. If you do not feel comfortable doing this, customer support can revert your database for you.
  1. Login to your web server via Telnet / SSH.

  2. All backup files are located in the /cgi-bin/xflow/backup/ directory of your server. The files are named by the date the backup was taken. Pick the backup file you would like to use, and unpack it by typing:
    tar -xzf FILENAME.tar.gz

  3. This will unpack the /xflow_data/ directory from the backup file. First, you need to either delete or rename the existing /xflow_data/ directory on your server, which is currently in use.

  4. Move the recently unpacked /xflow_data/ directory, which should be on your server at /cgi-bin/wsr/backup/xflow_data/ to the correct location. Move it to where the /xflow_data/ directory you just deleted or renamed used to be located. You can easily move the entire directory, by typing something such as the following at the SSH prompt:
    mv xflow_data /home/username/xflow_data

  5. Change to the /xflow_data/tools/ directory on your server, and run the general.pl script by typing:
    ./general.pl

  6. Drop all current database tables by typing 'DROPDB' at the prompt, without the quotation marks.

  7. Exit the general.pl script by typing "0" at the prompt.

  8. There will be a SQL dump file located on your server at /xflow_data/dump.sql. Change to the /xflow_data/ directory, and load the dump file into your database by typing something such as:
    mysql -uDBUSER -pDBPASS DBNAME < dump.sql
That's it! If you've successfully completed all above steps, you're entire member database will have been successfully reverted to the backup. You can now continue running your program.