You can backup all of your data for nBill, or even your entire Joomla site, using the
backup/restore feature. This feature backs up the data held in your database only, not the
actual program files. You can also restore a previously saved backup from here, and again,
you can choose to restore just the Billing tables, or the whole of Joomla (the latter obviously
would only work if you had backed up the whole of Joomla!).
Warning! Do not rely on this feature - you should have other provisions for backing up your
data. It is not always possible for nBill to backup and restore your data successfully especially
if it contains accented characters or symbols - depending on how these are encoded. Backup
files generated with different versions of MySQL (your database server software) may not be
compatible with each other.
To access the backup/restore page, select Configuration>Backup/Restore from the main
menu as shown in figure 3.20.
Figure 3.20 - Accessing the Backup/Restore Page
This takes you to the screen illustrated in figure 3.21.
Figure 3.21 - Backup/Restore
Backup
You are offered two different links for downloading a backup of your data. The first just
contains the data in your nBill tables (those tables are prefixed with #__inv in your database -
where #_ is your Joomla table prefix - eg. jos_inv_vendor). The second link will download a
backup of all of the tables in your Joomla database.
Please note: The backup file is an unencrypted plain text mySQL dump. This means that all
of your data, including your clients' names and addresses are plainly visible in the file. You
should therefore be very careful about where you store your backups! Do not store them on
your web server, as that would put it at risk - even if it was stored in a private area, it could
still be vulnerable to a directory traversal attack.
Technical Note: The backup file consists of some comment lines and mySQL queries. If
you do a search and replace on the file to change all occurrences of #__ to your actual
Joomla table prefix, it would be possible to run the entire contents of the file as an SQL query
(eg. in phpMyAdmin) to restore the database. To be able to restore the file via nBill though,
the comments and #__ prefix should be left intact.
Restore
If you have a backup file that contains all of your Joomla tables, you can choose whether to
restore all of the tables or just the nBill tables. If the backup only contains the nBill tables and
you select to restore all tables, naturally only the nBill tables will be restored - the others will
remain untouched.
Select a backup file from your computer using the 'Browse...' button, and click on 'Restore' to
perform the restoration.
WARNING! Restoring from a backup file will wipe out the existing contents of your database.
If anything goes wrong during this process you could lose everything! Therefore, only use this
feature as a last resort or if you have nothing to lose!
Note: You cannot restore from a backup file that was made using a different version of nBill. If
the backup file was made using an older version, you can edit the first line of the backup file
using a text editor (such as notepad - not a word processor), to change the version number to
the current version. Then after you restore the file, click on the 'Home' menu item, and you will
be prompted to click a link to upgrade the database. This will convert the older database to
the correct format for your newer version of nBill.
For Example: If you made a backup file using version 1.2.0 SP1 of nBill, and then
upgraded to version 1.2.1, but wanted to restore the backup you made on the previous
version, your backup file might have something similar to this on the first line:
#INV_BACKUP_1.2.0SP1_1210412576
You could then change the 1.2.0SP1 to 1.2.1, so that it now reads:
#INV_BACKUP_1.2.1_1210412576
...and after you restore the file, you will be prompted to upgrade the tables so that they
comply with the structure required by 1.2.1.
However, you cannot restore a file that was backed-up using a newer version of nBill. In that
case, you would first have to upgrade to the newer version before running the restoration
process.
Tip: You can use the backup and restore feature to copy the contents of one copy of nBill
onto another server (eg. if you are running a local test site as well as a live site and want to
copy data from one to the other).
Technical Note: If you backup on one server and restore on another, this will only work if
the versions of mySQL on each server are compatible. Trying to restore a backup that was
made on a newer version of mySQL onto a server running an older version of mySQL might
cause errors. In that case, you would need to manually amend the backup file to remove any
elements that are not supported in the older version of mySQL.