Data backup
In iTop all the data (including the uploaded documents) are stored in the MySql database. Therefore it is highly recommended to have a database backup in place on a regular basis.
You can run a full backup of the database using the following mysqldump command:
On Linux systems:
/usr/bin/mysqldump --opt --default-character-set=utf8 --single-transaction --add-drop-database –-user=<user> --password=<password> <DB> | gzip > <file>
On windows systems:
mysqldump.exe --opt --default-character-set=utf8 --single-transaction --add-drop-database –-user=<user> --password=<password> <DB> > <file>
Where:
-
<user>
is the user name to connect to MySQL -
<password>
is the corresponding password -
<DB>
is the name of the database in which iTop is installed -
<file>
is the name of the archive file to produce
Once the content of the database is dumped, just archive this
dump and the file conf/production/config-itop.php
to
keep a full image of your iTop instance.
-
Make sure that you export the data in UTF-8 (
--default-character-set=utf8
) otherwise accentuated characters will be lost. -
The option
--single-transaction
has two effects: it produces a consistent backup since all tables are exported in one transaction, and it provides a workaround for the error 1449 (definer does not exist) which may happen if you export a database that was already re-imported from another system or created by a no longer existing user.
Restoring a backup
To restore a backup just re-import the MySQL dump and restore the configuration file.
If the datamodel uses password fields with reversible encryption, then be sure that the same encryption algorithm is used on the new and old systems: if the mcrypt PHP extension was present on the old system, then the mcrypt extension must be present on the new system as well. If mcrypt was not present, it must not be present either.
Note: User accounts passwords use a one-way encryption and are not affected by the presence of mcrypt.
If you backup the iTop database on a Windows server, all the
database table names will be in lowercase. When restored on Linux,
the table priv_internalUser
will be spelled
priv_internaluser
, which is different. In you cannot
log into iTop after restoring a backup, check that the table is
properly spelled. If needed, remane the table to
priv_internalUser
.
This should no longer occur starting with iTop 2.0 beta 2, since all the tables are now in lowercase.